bsamuels@datamansys.co.uk writes:
I copied this from a posting I saw on a newsgroup and it works perfectly well when run by root from the command line. However if I set it up to be run as a root cron job it doesn't work as it should.
[...]
Can anyone offer advice as to why this should be happening?
Almost certainly a path problem, I would expect. While ifconfig may be in root's default path, cron tends to run with a different environment to minimise security problems. Try giving full path of things like ifconfig and see what happens.
MJ Ray markj@cloaked.freeserve.co.uk wrote:
bsamuels@datamansys.co.uk writes:
I copied this from a posting I saw on a newsgroup and it works perfectly well when run by root from the command line. However if I set it up to be run as a root cron job it doesn't work as it should.
[...]
Can anyone offer advice as to why this should be happening?
Almost certainly a path problem, I would expect. While ifconfig may be in root's default path, cron tends to run with a different environment to minimise security problems. Try giving full path of things like ifconfig and see what happens. -- MJR
I've tried the full paths and it does work! Fiendish - these cron jobs!
Many thanks
Barry Samuels