Hi there

What i'm trying to do is automate a virus scan and back up on some of the 
folders on my server. I'm really new at this so any help is much appreciated 
:)

First off, to automate a process i have to set it up in the /etc/crontab 
correct?

Also, what do i do if i want the info to be sent to someone other that root 
when the virus scan and back up run?

THis is what i've added in my /etc/crontab file:

00 2 * * sun sweep /www/servers/skylight.ubc.ca/media/ 
/www/servers/skylight.ubc.ca/profsTalk > 
/www/logs/skylight.ubc.ca/virusLog/log

00 1 * * sun /root/scripts/backup.sh


Okay, so i'm pretty sure that the above is correct. However, when i pipe out 
the results of the virus scan to a log file, i want to use the date as the 
name of the log file. IS there any way that i can do this?

Second, the cron tab will run the backup.sh script file. I've just started 
to write this script file but i'll a little unsure of what to do. I'm just 
writing this out as psuedo code, this is what i've got so far:

#
# Back up shell script
#

#!/usr/bin/bash

$currDate = getDate;
mkdir /data/backups/$currDate

# Backup the web server files
tar cfv www.tar /data/www
gzip www.tar
mv www.tar /data/backups/$currDate/

# Backup the database
mysqldump --all-databases -udlee -psomepassword > /data/backups/$currDate/


What i'm trying to do is make a directory with the currrent date in teh 
existing directory /data/backups. Is ther eany way that i can get this date 
and use i in a variable? Above i just put in "getDate" for filler.

Also, I think i have to be root to run the above commands, should this be a 
problem, or does the crontab run the backup.sh script as root?


Thanks a bunch for any help

Desmond

_________________________________________________________________
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx



-- 
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to