Annotation of sludge_scripts/backup.sh, revision 1.1

1.1     ! nick        1: #!/bin/bash
        !             2: 
        !             3: REMOTE="nick@demandred.dyndns.org"
        !             4: OPTIONS="-avxz -e ssh --delete"
        !             5: LOGDIR=/home/backup/logs
        !             6: DATE=`date +%Y%m%d`
        !             7: 
        !             8: DIRS=( /home/nick/database-backup.dump.gz /home/nick/database-backup.dump.yesterday.gz /home/nick/DroidBackups /home/winshare/Pictures /home/cvs /home/nick/bbs /home/nick/notes /home/httpd /home/nick/Documents /home/nick/mail /home/nick/mail-backup /home/winshare/Documents )
        !             9: 
        !            10: LANFEAR_DIRS=(/home/backup/systems/lanfear/home/nick/Documents /home/backup/systems/lanfear/home/nick/Receipts "/home/backup/systems/lanfear/home/nick/Nick\'s Pictures" /home/backup/systems/lanfear/home/nick/projects /home/backup/systems/lanfear/home/nick/notes)
        !            11: 
        !            12: [ -d $LOGDIR ] || mkdir -p $LOGDIR
        !            13: 
        !            14: cd /home/backup/backups
        !            15: mkdir -p demandred
        !            16: cd demandred
        !            17: for DIR in "${DIRS[@]}"; do
        !            18:        /usr/bin/rsync $OPTIONS $REMOTE:$DIR . >> $LOGDIR/backup-$DATE.log 2>&1
        !            19: done
        !            20: cd -
        !            21: 
        !            22: mkdir -p lanfear
        !            23: cd lanfear
        !            24: for DIR in "${LANFEAR_DIRS[@]}"; do
        !            25:        /usr/bin/rsync $OPTIONS $REMOTE:$DIR . >> $LOGDIR/backup-$DATE.log 2>&1
        !            26: done
        !            27: cd -
        !            28: 
        !            29: ##
        !            30: ## Compress logs after 5 days and delete logs after 6 months
        !            31: ##
        !            32: find $LOGDIR -type f -name \*.gz -mtime +180 -exec rm -f {} \;
        !            33: find $LOGDIR -type f -name \*.log -mtime +5 -exec gzip -9 {} \;

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>