Difference between revisions of "Backup2"
From ITSwiki
[quality revision] | [quality revision] |
(→Linux) |
|||
Line 11: | Line 11: | ||
echo "USERNAME" > /opt/imm_rsync_backup/remote_username | echo "USERNAME" > /opt/imm_rsync_backup/remote_username | ||
− | Enter absolute directory paths that should be backed up in <code>/opt/imm_rsync_backup/include</code>. One per line. Example: | + | Enter '''absolute''' directory paths that should be backed up in <code>/opt/imm_rsync_backup/include</code>. One per line. Example: |
/home | /home | ||
Line 17: | Line 17: | ||
/etc | /etc | ||
− | Enter relative directory paths that should be excluded from the backup in <code>/opt/imm_rsync_backup/include</code>. One per line. Example: | + | Enter '''relative''' directory paths that should be excluded from the backup in <code>/opt/imm_rsync_backup/include</code>. One per line. Example: |
lost+found | lost+found |
Revision as of 16:41, 19 November 2013
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.