Here is a sample shell script:
Code:
#!/bin/bash
# dirs to backups
DIRS="/path/to/events /path/to/marketing"
# Save zip file elsewhere on the server
DEST="/disk2/archive"
# set to "no" keep old zip file and add new file
DELETE_OLD_ZIP_FILES="yes"
#Path to binary files
BASENAME=/usr/bin/basename
ZIP=/usr/bin/zip
for d in $DIRS
do
zipfile="${DEST}/$(${BASENAME} ${d}).zip"
echo -n "Creating $zipfile..."
if [ "$DELETE_OLD_ZIP_FILES" == "yes" ]
then
[ -f $zipfile ] && /bin/rm -f $zipfile
fi
# create zip file
${ZIP} -r $zipfile $d &>/dev/null && echo "Done!"
done
Save this file to /root/mkserverzip.sh and set cron job as follows to backup it up weekly:
Code:
@weekly /root/mkserverzip.sh
See cron tutorial for more info:
How do I add jobs to cron under Linux or UNIX oses?
Modify script as per your setup.
__________________
Vivek Gite
Linux Evangelist

Be proud
RHEL user, and let the world know about your enterprise choices!
Join RedHat user group.

Always use
CODE tags for posting system output and commands!

Do you run a Linux? Let's face it,
you need help