3 source /etc/backup-helper
5 DATE=`date +%Y%m%d-%H%M`
8 ps -C postmaster 2>&1 >/dev/null
10 backup_all_dbs /mnt/backup $HOST $DATE
13 # thierry : tmp backup solution on gorillaz
14 # note that in addition to the db dumps in /mnt/backup, this also keeps a backup of
15 # (*) /etc/ and in particular /etc/planetlab + all other crontabs and backup-helper
16 # (*) /var/www/html for the drupal themes and other stuff
17 # (*) /root with various tweaks in particular in /root/thierry
18 # in general this is not intended to be restored as-is (as it might overwrite too much stuff)
19 # but can be helpful so, just in case ...
21 # baris: create archive files in /mnt/backup for /etc /var/www/html and /root respectively and sync only /mnt/backup
22 # bicudo: added 'cd /' to stop with crontab huge mails
23 for d in etc var/www/html root
26 dir_name=`echo ${d} | sed 's/\//_/g'`_
27 tar cjf /mnt/backup/${HOST}_${dir_name}${DATE}.tar.bz2 $d
30 # baris: copy all files from today to the "latest" directory.
32 LATESTDATE=`date +%Y%m%d`
33 LATEST=/mnt/backup/latest
35 mkdir -p ${TMP} && cp -r $BACKUP/*${LATESTDATE}*.bak $TMP && rm -rf $LATEST && mv $TMP $LATEST
37 for d in etc var/www/html root
40 rsync --archive --verbose --relative --delete /$d/ $LATEST/$d/
43 rsync --archive --verbose --relative --delete /mnt/backup/ --exclude '*~' root@gorillaz:/backup-ple-www