| Author |
ftp in crontab is not working
|
manoj r patil
Ranch Hand
Joined: Jun 06, 2002
Posts: 180
|
|
I have written one shell script for uploading some files using ftp. I configured .netrc to use non-interactive mode for logging in to ftp. When I run the script manuall, everything works fine. But when I add this file in crontab, the job gets executed but it does not do ftp. Below is the snippet of the script for quick reference - -------------- ftp $IP_ADDRESS <<INPUT_END> passive cd $TARGET_PARENT_PATH/$CUSTOMER_ACCOUNT/ put $PARENT_PATH/$CUSTOMER_ACCOUNT/$l_filename $l_filename quit INPUT_END -------------- Thanks in advance
|
love your job and not your company;
...because you never know when your company will stop loving you!
|
 |
Craig Taylor
Ranch Hand
Joined: Jul 17, 2008
Posts: 64
|
|
Remember that when the cron commands are run that the script environment is fairly sparse. Environment variables such as $PATH are typically missing or non-existant. Try ensuring the you use : '/bin/ftp' or whereever ftp is located on your system. Hope that helps,
|
 |
manoj r patil
Ranch Hand
Joined: Jun 06, 2002
Posts: 180
|
|
Craig, you were right! Actually I have used absolute path everywhere else but for ftp thinking that it will be in the standard places of linux. To my surprise, I found ftp at /usr/kerberos/bin and after adding this before ftp, it worked! Thanks a lot!
|
 |
 |
|
|
subject: ftp in crontab is not working
|
|
|