{"id":5494,"date":"2023-09-11T23:32:00","date_gmt":"2023-09-12T04:32:00","guid":{"rendered":"https:\/\/www.incredigeek.com\/home\/?p=5494"},"modified":"2023-09-11T21:40:43","modified_gmt":"2023-09-12T02:40:43","slug":"backup-uisp-application-backup-files-with-rsync","status":"publish","type":"post","link":"https:\/\/www.incredigeek.com\/home\/backup-uisp-application-backup-files-with-rsync\/","title":{"rendered":"Backup UISP Application Backup Files with Rsync"},"content":{"rendered":"\n<p>UISP runs inside of a docker container.  To copy out the backup files we need to use the &#8220;docker cp&#8221; command.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo docker cp unms:\/home\/app\/unms\/data\/unms-backups .\/uisp-backups<\/pre>\n\n\n\n<p>This will copy the backups into  .\/uisp-backups directory.<\/p>\n\n\n\n<p>On an Ubuntu system, docker needs sudo permissions.  If you copy the backups with the above command, the backup files will be assigned to the root user and you will not be able to use your normal user to manipulate the files.<\/p>\n\n\n\n<p>You can either add your <a href=\"https:\/\/www.incredigeek.com\/home\/give-ubuntu-user-access-to-run-docker\/\">current user to the Docker group<\/a>, or change the files owner<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo chown username:username -R .\/uisp-backups\/<\/pre>\n\n\n\n<p>We can now copy all the automatic backups with rsync<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo rsync -a .\/uisp-backups -e \"ssh -p 22\" backupuser@backuphost:\/backups<\/pre>\n\n\n\n<p>You can also automate this with Cron by doing something like<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">1 1 * * 1 docker cp unms:\/home\/app\/unms\/data\/unms-backups ~\/uisp-backups &amp;&amp; rsync -a ~\/uisp-backups -e \"ssh -p 22\" backupuser@backuphost:\/backups<\/pre>\n\n\n\n<p>Every Monday at 1:01AM, copy the current UISP automatic backups, then use rsync to copy them to a remote server. <\/p>\n\n\n\n<p>This expects that the current user has permissions to call Docker without sudo.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>UISP runs inside of a docker container. To copy out the backup files we need to use the &#8220;docker cp&#8221; command. sudo docker cp unms:\/home\/app\/unms\/data\/unms-backups .\/uisp-backups This will copy the backups into .\/uisp-backups directory. On an Ubuntu system, docker needs &hellip; <a href=\"https:\/\/www.incredigeek.com\/home\/backup-uisp-application-backup-files-with-rsync\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[129],"tags":[244,75,302,246,131,974,1571],"class_list":["post-5494","post","type-post","status-publish","format-standard","hentry","category-ubiquiti","tag-automation","tag-backup","tag-backups","tag-docker","tag-ubiquiti-2","tag-ui","tag-uisp"],"_links":{"self":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/5494","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/comments?post=5494"}],"version-history":[{"count":5,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/5494\/revisions"}],"predecessor-version":[{"id":5505,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/5494\/revisions\/5505"}],"wp:attachment":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/media?parent=5494"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/categories?post=5494"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/tags?post=5494"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}