Paul,On Mon, April 18, 2005 8:22, Rosemary McGillicuddy said:
No, it is the actual command that you type in to run the script.
So I might have errors then?
Mikkel advised you to add a script to /etc/cron.daily. Running the script by hand would need the "./" prefix.
To get a script called 'virusscan.sh' in place, do the following:
open an xterm su (to become root) cd /etc/cron.daily vi virusscan.sh <press "i" to go to insert mode in vi> <type the f-prot scan command we figured out. Make sure you enter the entire path-name to the f-prot program, with cron you do not want to rely on PATH settings> <press ESCape to go to command mode in vi> type :wq
Then, on the prompt, type
chmod +x virusscan.sh (This makes the script eXecutable.)
Type 'exit' (without quotes) to go back to your regular useraccount.From there, the daily cron-run should pick up the virusscan.sh scriptand execute it every day.
Good luck Paul
I find it works better to edit, and test, at least as far a possible, as a normal user, instead of root. This is especialy true when you are new to writing scripts. Once you have the script working, then you become root, change ownership of the file, and put it where it will be run.
If the script needs to run as root to test it, it is still better to run it from the command line before letting cron run it. That way, you at least have a chance to limit the damage if you did make a mistake.
Something to think about - what happens if you run:
echo test > /dev/hda
as a user, and as root? (DO NOT RUN IT AS ROOT!!!)
Mikkel --
Do not meddle in the affairs of dragons, for you are crunchy and taste good with Ketchup!
____________________________________________________ Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com Join the Club : http://www.mandrakeclub.com ____________________________________________________
