Backup2

From ITSwiki
Revision as of 16:41, 19 November 2013 by Mttj (Talk | contribs)


Jump to: navigation, search

Linux

Replace USERNAME with your DTU initials.

ssh-keygen -t dsa
ssh-copy-id -i ~/.ssh/id_dsa.pub USERNAME@userbackup1.imm.dtu.dk
sudo bash
mkdir -p /opt/imm_rsync_backup/logs
wget ...
chmod 755 /opt/imm_rsync_backup/script.sh
echo "USERNAME" > /opt/imm_rsync_backup/remote_username

Enter absolute directory paths that should be backed up in /opt/imm_rsync_backup/include. One per line. Example:

/home
/var/log
/etc

Enter relative directory paths that should be excluded from the backup in /opt/imm_rsync_backup/include. One per line. Example:

lost+found
temp
project/test

Schedule the backup to be preformed. Here 9:15 is chosen, but it should be a time, where you know your computer is turned on.

echo " 15  9  *  *  * root /opt/imm_rsync_backup/script.sh" >> /etc/crontab
service crond restart
exit

OSX

Replace USERNAME with your DTU initials.

ssh-keygen -t dsa
cat ~/.ssh/id_dsa.pub | ssh USERNAME@userbackup1.imm.dtu.dk "mkdir -m700 .ssh ; cat - >> .ssh/authorized_keys"

Depending on your current ssh setup the mkdir may return "file exists" warning, this does not matter.