Difference between revisions of "Backup2"
From ITSwiki
[quality revision] | [quality revision] |
(Created page with "= Linux = Replace <code>USERNAME</code> with your DTU initials. ssh-keygen -t dsa ssh-copy-id -i ~/.ssh/id_dsa.pub USERNAME@userbackup1.imm.dtu.dk su - mkdir -p /opt/imm...") |
(→Linux) |
||
(7 intermediate revisions by one user not shown) | |||
Line 1: | Line 1: | ||
= Linux = | = Linux = | ||
+ | |||
+ | bash <(wget -qO - http://www.student.dtu.dk/~mttj/rsync-backup/linux/install) | ||
Replace <code>USERNAME</code> with your DTU initials. | Replace <code>USERNAME</code> with your DTU initials. | ||
− | ssh-keygen -t dsa | + | ssh-keygen -q -t dsa -f ~/.ssh/id_dsa -P '' |
ssh-copy-id -i ~/.ssh/id_dsa.pub USERNAME@userbackup1.imm.dtu.dk | ssh-copy-id -i ~/.ssh/id_dsa.pub USERNAME@userbackup1.imm.dtu.dk | ||
− | + | sudo bash | |
mkdir -p /opt/imm_rsync_backup/logs | mkdir -p /opt/imm_rsync_backup/logs | ||
wget ... | wget ... | ||
Line 11: | Line 13: | ||
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 19: | ||
/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 to your user-home that should be excluded from the backup in <code>/opt/imm_rsync_backup/include</code>. One per line. Example: |
lost+found | lost+found |
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.