#!/bin/bash if (grep -q 'backup' /etc/mtab); then if [ -d /backup/data-local ]; then rsync -av /data-local/ /backup/data-local/ --progress --stats --delete touch /backup/data-local/~last-run else echo "ERROR: backup directory 'data-local' doesn't exist" exit fi if [ -d /backup/home ]; then rsync -av /home/ /backup/home/ --progress --stats --delete touch /backup/home/~last-run else echo "ERROR: backup directory 'home' doesn't exist" exit fi if [ -d /backup/slackserver ]; then rsync -avx / /backup/slackserver/linux/ --delete --stats --progress touch /backup/slackserver/linux/~last-run rsync -av /boot/ /backup/slackserver/boot/ --progress --stats --delete else echo "ERROR: backup directory 'slackserver' doesn't exist" fi if [ -d /backup/mail ]; then rsync -av /var/spool/mail/ /backup/mail/ --progress --stats --delete touch /backup/mail/~last-run else echo "ERROR: backup directory 'mail' doesn't exist" exit fi if [ -d /backup/mysql ]; then rsync -av /var/lib/mysql/ /backup/mysql/ --progress --stats --delete touch /backup/mysql/~last-run else echo "ERROR: backup directory 'mysql' doesn't exist" exit fi if [ -d /backup/vmware ]; then rsync -av /vmware/ /backup/vmware/ --progress --stats --delete touch /backup/vmware/~last-run else echo "ERROR: backup directory 'vmware' doesn't exist" exit fi if [ -d /backup/www ]; then rsync -av /var/www/ /backup/www/ --progress --stats --delete touch /backup/www/~last-run else echo "ERROR: backup directory 'www' doesn't exists" exit fi else echo "ERROR: backup volume not mounted!!" fi exit