[Nottingham] Contab script error

David Wolfson eaxdrw at nottingham.ac.uk
Fri Jul 16 12:36:30 BST 2004


I have a problem with a cron job that I'm trying to set up.  It's meant to run a virus sweep of user files and (to begin with) report to a log file.  I've written a script (located in /bin) to run the 'sweep' program with the correct parameters, and added this script to crontab.  

When I run the script manually it works fine.  However when cron tries to run it, I get an error report that the 'sweep' command can't be found.  'sweep' is located in /usr/local/bin and permission are 755.  

I don't get it.

The 'runsweep' script looks like this:

#!bin/bash
sweep -f -dn -all -p=/root/log/sweep.log /home
and as I say, runs fine when run manually.

The line in crontab looks like this:
01 0 * * 0-7 root ./bin/runsweep.sh >> /root/log/sweep.log
and appears to try to run the above script.

Does cron have a different set of environment variables to root?  My guess would be that it's not looking for 'sweep' in /usr/local/bin..?

Any suggestions please?

Thanks,

Dave

PS due for another thread soon but just to get the though in your heads.  I'm about to get the 2nd harddive in to setup the duel boot BinXp-Linux at home...  Which distro?



This message has been scanned but we cannot guarantee that it and any
attachments are free from viruses or other damaging content: you are
advised to perform your own checks.  Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.




More information about the Nottingham mailing list