[SOLVED] Setting up a cron for transferring a file through FTP at 5 PM daily
AIXThis forum is for the discussion of IBM AIX.
eserver and other IBM related questions are also on topic.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
@lithos - When I type this command and hit enter, no error is thrown. It just feels like the command has been executed successfully but without effecting the idea behind it - the files to be purged still stays.
@evilputty - I'm new to Unix. Can you please elaborate on how this parsing could be done ?
since its based off modified time not the time located within the filename.
you could use this script to set the modified time to the existing files to the date appended to the filename.
Code:
#!/bin/sh
for filename in /location/to/pso_whse_orders_inout.*
do
MODDATE=`echo $filename | sed -n 's/^.*\.\([0-9]*\)$/\1/p'`
touch $filename -t $MODDATE"1200"
done;
not sure for solaris but it works fine with linux
Last edited by evilputty; 03-16-2012 at 02:41 PM.
Reason: add script to change modified time
Moved: This thread is more suitable in Solaris/Opensolaris and has been moved accordingly to help your thread/question get the exposure it deserves. Thanks druuna for reporting.
Ok guys. I just figured out that the same command is working now as the problem was with the time of the file when it was created and not just in the date mentioned in the filename. The command
I am marking this thread as resolved now.
Sorry for the confusion on OS & thanks to everyone who contributed your valuable suggestions.
Thanks Druuna. FTP connectivity works now, but have 2 more issues to resolve with my script.
I have written this script for a FTP transfer, but I am not able to get the files in the required directory even after the cd command before connecting to FTP. I'm running this script from a different directory & I want the file to come into a specific directory. I assumed to change the working directory before connecting to FTP, but its not working. The file is coming to the same directory where I am running the script from. Please help ASAP.
Also, the script doesn't purge the files which are more than 3 days old. Pls help on this as well.
In the last command. I want to purge older than 3 days files.
Like for example, there are the following files in the directory :
pso_whse_orders_inout.20120312
pso_whse_orders_inout.20120313
pso_whse_orders_inout.20120314
pso_whse_orders_inout.20120315
pso_whse_orders_inout.20120316
Then the directory will be left over with the last 3 days' files :
pso_whse_orders_inout.20120314
pso_whse_orders_inout.20120315
pso_whse_orders_inout.20120316
Any ideas ?
how i can download all files from specific folder from remote computer
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.