Attention: All pages of this wiki depend on the pages that come before it, in order as they are listed on the Main Page. Please check for Dependencies.
Please also look at What You Need to Know Before Using This Wiki

Install Rsnapshot

From COCNM
Jump to: navigation, search

System Prep

  • Note: In production this machine should be in a different building than houselian
  • apt-get install rsnapshot
  • Set up partitioning and fstab with the following considerations:
    • mount your backup volume under /home/backups
    • carve a 5 GB partition and mount it under /home/porchlian
    • carve a 20 GB partition and mount it under /home/houselian

Configure Rsnapshot

Configure Exim

  • dpkg-reconfigure exim4-config
  • send by smart host, no local mail=>set System Name as computerisms.com=>Set IP as 127.0.0.1=>No destinations accepted=>set Visible Name as computerisms.com=>Set hostname as mail.computerisms.com=>no=>no

Distribute SSH Keys

  • ssh-keygen -b 4096 -t rsa (empty passphrase)
  • i=$(cat /root/.ssh/id_rsa.pub); ssh root@192.168.26.10 "echo $i >> /root/.ssh/authorized_keys"
  • i=$(cat /root/.ssh/id_rsa.pub); ssh root@192.168.26.1 "echo $i >> /root/.ssh/authorized_keys"
  • ssh root@192.168.26.10 <= Make sure you can log in without a password
  • exit
  • ssh root@192.168.26.1 <= Make sure you can log in without a password
  • exit

Set Up Database Dumps and Samba Backups

  • ssh root@192.168.26.10
  • mkdir /root/SQLDumps
  • mkdir /usr/local/SambaBackups
  • chmod 750 /root/S* /root/scripts/
  • vi /root/scripts/SQLdump.sh
  • sed 's!WHERE=/usr/local/backups!WHERE=/usr/local/SambaBackups!' /usr/src/samba-4.0.7/source4/scripting/bin/samba_backup > /usr/local/samba/bin/samba_backup
  • crontab -e
    • 10 21 * * * bash /root/scripts/SQLdump.sh
    • 10 42 * * * bash /usr/local/samba/bin/samba_backup
  • exit

Set Up All the Automation

  • crontab -e
    • 00 21 * * * bash /root/scripts/rsnap.daily.sh
    • 01 21 * * 6 /usr/bin/rsnapshot weekly
    • 02 21 * * * nice -10 rsync -aHAXx --delete --exclude *.gvfs --exclude /proc --exclude /sys --exclude /dev --exclude /media --exclude /mnt --exclude /home --exclude /service root@192.168.26.10:/* /home/houselian
    • 03 21 * * * nice -10 rsync -aHAXx --delete --exclude *.gvfs --exclude /proc --exclude /sys --exclude /dev --exclude /media --exclude /mnt root@192.168.26.1:/* /home/porchlian

Restoring Porchlian/Houselian

  • reverse the rsync to a partition on a new drive, use a boot disk to install grub2 on that drive, and it will boot