ftp script is not running from CRON

Hi

I have an FTP script, which ftp's the files from one unix box to another box.

It works from the command when I Issue > ksh ftp.ksh

when I schedule it in CRON, it is not being executed automatically.

Any thoughts please

Thanks
Ravi.

Your environment isnt good...
For a start cron only knows /bin:/usr/bin...
All variables, PATH etc... you use should be set in your ftp.ksh file, then you will have to call the script by using absolute path... ($HOME will not work also since HOME isnt set...)

To troubleshoot cron problems, redirect the stderr to a file or an active tty and set the cron every minutes or so.

* * * * * /full/path/to/command 2> /tmp/cron.err  # to file
* * * * * /full/path/to/command 2> /dev/pts/0      # to tty

And you will see the error. Most of the time it will be a "command not found" type of error as suggested above.

You can use this kind of cron entry to test the job ! But you should consciously remove it after testing, hence it is a dangerous thing that it will get executed every minute again and again, can cause lot of problems without your knowledge..

It goes without saying.

When you troubleshoot a script your are supposed to know what you are doing. With great power comes great responsibilities as the saying goes...