Linux: Server Backup

To backup the server (Gentoo-based), the time-based job scheduler named (vixie) cron will be used.

The following how-to is based on Wedos Disk manual. However, once syncing to a different mount point, the rsync command will remain the same.

Wedos Disk Oriented How-To

Create an executable /etc/cron.daily/syncandencrypt file to rsync (backup) the whole system everyday.

# Mount the Wedos Disk volume into /mnt/wedosdisk as per /etc/fstab
if grep -qs '/mnt/wedosdisk' /proc/mounts;
echo "WEDOS disk mounted.";
mount /mnt/wedosdisk;

# Mount the encrypted TrueCrypt backup.ts container located in /mnt/wedosdisk/ (physically at Wedos Disk) into /mnt/zaloha
echo "Mounting TrueCrypt volume...";
truecrypt --text --keyfiles="" --protect-hidden=no --force --password=*************** /mnt/wedosdisk/ /mnt/backup

# backup copy the selected files and directories into the encrypted volume (/mnt/zaloha)
#rsync -avn /* /mnt/backup --exclude={/dev/*,/proc/*,/sys/*,/tmp/*,/run/*,/mnt/*,/media/*,/lost+found,/home/*/.gvfs,/usr/portage/*,/usr/src,/var/log,/var/tmp,/var/db,/var/cache/edb,/var/lib/boinc} > /root/rsync.details.txt
rsync -aq /* /mnt/backup --exclude={/dev/*,/proc/*,/sys/*,/tmp/*,/run/*,/mnt/*,/media/*,/lost+found,/home/*/.gvfs,/usr/portage/*,/usr/src,/var/log,/var/tmp,/var/db,/var/cache/edb,/var/lib/boinc}

# Unmount the ecrypted container
echo "Unmounting...";
truecrypt -d /mnt/wedosdisk/

echo "Done.";


This entry was posted in Linux, Security, Server and tagged , , , , . Bookmark the permalink.