--- Matt Johnson
I've written a script to upload some static html pages to an ftp server. I've used .netrc for the connection settings. It all works well when I run the script.
Nice call. The use of .netrc is a good idea, especially for autoloading of settings.
Now, I've put that script in /etc/cron.daily and on the RedHat system I've got, that should run at 4am. But it doesn't work. The logs show that it fails to login to the remote FTP system when the job is run by cron.
:-) Hmmm, which user are you using to ftp the files over? And which ftp daemon are you using? I'd be more inclined to write another "wrapper" shell script that actually "su"'s to the "ftp" user and then uploads it that way. The reason most likely, as to why it doesn't work is because all crom services that are ran, are ran as "root" which would give you permission errors.
To summarise... The script works if I now sit here and type:
/etc/cron.daily/webupdate
It doesn't work if I change the system time to 4am and watch it try! Fails to login.
See above.
I've checked the permissions on the script in /etc/cron.daily are the same as the others in that directory.
HTH, -- Thomas Adam ===== Thomas Adam "The Linux Weekend Mechanic" -- www.linuxgazette.com __________________________________________________ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com