Here is an example of a simple backup script I use to backup some files and copy them to another machine to be put on tape.
echo $HOSTNAME > /var/log/backup.log echo "Backup Started: " >> /var/log/backup.log date >> /var/log/backup.log tar --create --verbose --bzip2 --file /root/tuxtracker.tar.bz2 --files-from /etc/backup-list --exclude-from /etc/backup-exclude >> /var/log/backup.log 2>&1 echo "Backup Stoped: " >> /var/log/backup.log date >> /var/log/backup.log echo "Transfer to Annex Started: " >> /var/log/backup.log date >> /var/log/backup.log if scp -q /root/tuxtracker.tar.bz2 [EMAIL PROTECTED]:. >> /var/log/backup.log 2>&1 then echo "Transfer to Annex Finished Successfully: " >> /var/log/backup.log date >> /var/log/backup.log else echo "Transfer to Annex was Interrupted: " >> /var/log/backup.log date >> /var/log/backup.log fi The first line creates a log file and all other lines append to it.
signature.asc
Description: This is a digitally signed message part