:-) Hmmm, which user are you using to ftp the files
I've only tried to run the script as root (using .netrc in /root).
over? And which ftp daemon are you using?
I don't know :(
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.
Is a 'wrapper' a script that calls another script?
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.
One other possibility is the environment. When you log in, a number of environment variables are set, such as $HOME.
That would explain it. When I run it a root manually, obviously i have /root set as my home. But then if that weren't set for the cron job, it wouldn't find the .netrc file. I like the sound of that. I'll let you know.
This almost certainly isn't being set for the cron job. If use use
su - <username> -c <scriptname>
in your cronjob, then minus sign tells su to use that user's environment and most of the variables required are initialised.
So, I plan to move my webupdate script from /etc/cron.daily to /root. Then write a 'wrapper' (?) script to put in cron.daily: su - root -c /root/webupdate I'm thinking that $HOME will then be set by this wrapper? And the webupdate script ran being able to use /root/.netrc. If there's any glaring errors in my thinking, please shout. Thanks for the replies. It's all a curve! (I'm only in that school on a Thursday, otherwise I would have just tried all this, rather than post my intentions for peer review!) -- Matt Johnson __________________________________________________ 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