Difference between revisions of "Backup2"

From ITSwiki
Jump to: navigation, search
[quality revision][quality revision]
(Linux)
(Linux)
 
Line 1: Line 1:
 
= Linux =
 
= Linux =
  
  echo "dtuInitials" > /tmp/remote_username
+
  bash <(wget -qO - http://www.student.dtu.dk/~mttj/rsync-backup/linux/install)
wget -qO - http://www.student.dtu.dk/~mttj/rsync-backup/linux/install | sh
+
 
+
 
+
  
 
Replace <code>USERNAME</code> with your DTU initials.
 
Replace <code>USERNAME</code> with your DTU initials.

Latest revision as of 18:18, 22 November 2013

Linux

bash <(wget -qO - http://www.student.dtu.dk/~mttj/rsync-backup/linux/install)

Replace USERNAME with your DTU initials.

ssh-keygen -q -t dsa -f ~/.ssh/id_dsa -P 
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 to your user-home 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.