{"id":2325,"date":"2015-04-27T12:03:40","date_gmt":"2015-04-27T11:03:40","guid":{"rendered":"http:\/\/roboblog.fatal-fury.de\/?p=2325"},"modified":"2015-04-27T12:04:05","modified_gmt":"2015-04-27T11:04:05","slug":"rsync-cron-ssh-daily-compressed-remote-backup","status":"publish","type":"post","link":"http:\/\/roboblog.fatal-fury.de\/?p=2325","title":{"rendered":"rsync cron ssh - daily compressed remote backup"},"content":{"rendered":"<p><strong>Add user<\/strong><br \/>\nAdd user on you lokal and remote host. Disable password auth on your remote host:<br \/>\n# adduser --disabled-password user<\/p>\n<p>Create authentication keys on your lokal machine<br \/>\n$ ssh-keygen -t rsa<\/p>\n<p>Copy user\/.ssh\/id_rsa.pub to the end of remote host user\/.ssh\/authorized_keys<\/p>\n<p><strong>rsync command<\/strong><br \/>\n-h humand readable<br \/>\n-P show progress<br \/>\n-a archive mode<br \/>\n-v verbode<br \/>\n-z compress<br \/>\n-e using ssh<\/p>\n<p>sync --stats -hPavze ssh \/home\/user user@remotehost:\/home\/user\/daily<\/p>\n<p><strong>lokal cron command<\/strong><br \/>\nPut this in an extra file in  \/etc\/cron.d\/<br \/>\nCalls rsync with username user daily at 10:01pm<br \/>\nThe current date, standard and error output from rsync is redirected to cronlog file.<\/p>\n<p>1 22 * * *   user  date >> \/home\/buchhaltung\/cronlog;  rsync --delete --stats -hPavze ssh \/home\/user user@remotehost:\/home\/user\/daily >> \/home\/user\/cronlog 2>&1<\/p>\n<p><strong>remote cron command<\/strong><br \/>\nPut this in an extra file in  \/etc\/cron.d\/<br \/>\nMake a compressed backup every day at 11:01pm<br \/>\n 1 23 * * *   user    tar -cvjf \/home\/user\/dailybackup\/daily_$(date +%Y%m%d).tar.bz2 \/home\/user\/daily\/ <\/p>\n<p><strong>usefull links<\/strong><br \/>\nhttp:\/\/www.marksanborn.net\/howto\/use-rsync-for-daily-weekly-and-full-monthly-backups\/<br \/>\nhttp:\/\/www.marksanborn.net\/linux\/learning-cron-by-example\/<br \/>\nhttp:\/\/www.linuxproblem.org\/art_9.html<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Add user Add user on you lokal and remote host. Disable password auth on your remote host: # adduser --disabled-password user Create authentication keys on your lokal machine $ ssh-keygen -t rsa Copy user\/.ssh\/id_rsa.pub to the end of remote host user\/.ssh\/authorized_keys rsync command -h humand readable -P show progress -a archive mode -v verbode -z [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[18],"class_list":["post-2325","post","type-post","status-publish","format-standard","hentry","category-allgemein","tag-linux"],"_links":{"self":[{"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=\/wp\/v2\/posts\/2325","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2325"}],"version-history":[{"count":1,"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=\/wp\/v2\/posts\/2325\/revisions"}],"predecessor-version":[{"id":2326,"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=\/wp\/v2\/posts\/2325\/revisions\/2326"}],"wp:attachment":[{"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2325"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2325"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2325"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}