{"id":348365,"date":"2023-06-04T15:00:51","date_gmt":"2023-06-04T15:00:51","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=348365"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=348365","title":{"rendered":"<span>\u041a\u0430\u043a \u0434\u0435\u043b\u0430\u0442\u044c \u0431\u044d\u043a\u0430\u043f\u044b \u0431\u0435\u0437 \u043f\u0440\u043e\u0432\u043e\u0434\u043e\u0432: restic + MinIO (S3)<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<p>\u0414\u043e \u043d\u0435\u0434\u0430\u0432\u043d\u0435\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u044f \u0434\u0435\u043b\u0430\u043b \u0431\u044d\u043a\u0430\u043f\u044b \u0441\u0432\u043e\u0438\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 \u043d\u0430 \u0432\u043d\u0435\u0448\u043d\u0438\u0439 HDD. \u0422\u0430\u043a\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043c\u0435\u043d\u044f \u0443\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u043b \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0431\u044d\u043a\u0430\u043f\u0438\u043b \u0434\u0430\u043d\u043d\u044b\u0435 \u0440\u0435\u0434\u043a\u043e &#8212; \u0440\u0430\u0437 \u0432 \u043d\u0435\u0434\u0435\u043b\u044e. \u041a\u043e\u0433\u0434\u0430 \u0437\u0430\u0434\u0443\u043c\u0430\u043b\u0441\u044f \u043e \u0435\u0436\u0435\u0434\u043d\u0435\u0432\u043d\u044b\u0445 \u0431\u044d\u043a\u0430\u043f\u0430\u0445, \u043f\u043e\u043d\u044f\u043b, \u0447\u0442\u043e \u0431\u0435\u0433\u0430\u0442\u044c \u0441 \u0432\u043d\u0435\u0448\u043d\u0438\u043c HDD \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u043f\u0440\u0430\u043a\u0442\u0438\u0447\u043d\u043e. \u0425\u043e\u0447\u0443 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u0440\u043e \u0443\u0434\u043e\u0431\u043d\u043e\u0435 (\u043f\u043e \u043a\u0440\u0430\u0439\u043d\u0435\u0439 \u043c\u0435\u0440\u0435 \u0434\u043b\u044f \u043c\u0435\u043d\u044f) \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0435\u0436\u0435\u0434\u043d\u0435\u0432\u043d\u044b\u0445 \u0431\u0435\u043a\u0430\u043f\u043e\u0432 \u0431\u0435\u0437 \u043f\u0440\u043e\u0432\u043e\u0434\u043e\u0432.<\/p>\n<h3>restic<\/h3>\n<p>\u0414\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u0430\u043c\u0438\u0445 \u0431\u044d\u043a\u0430\u043f\u043e\u0432 \u044f \u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0441\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043e\u0439 <a href=\"https:\/\/github.com\/restic\/restic\" rel=\"noopener noreferrer nofollow\">restic<\/a>. \u042d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u0430\u044f CLI \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430, \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 \u0432\u0441\u0435\u0445 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u041e\u0421 \u0442.\u043a \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0430 \u043d\u0430 Go. \u041f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0434\u0435\u043b\u0430\u0442\u044c \u0431\u044d\u043a\u0430\u043f\u044b \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e, \u043d\u0430 \u0432\u043d\u0435\u0448\u043d\u0438\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0438 \u0432 \u043e\u0431\u043b\u0430\u0447\u043d\u044b\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438. \u0414\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u0441\u0436\u0438\u043c\u0430\u0435\u0442 \u0444\u0430\u0439\u043b\u044b, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0431\u044d\u043a\u0430\u043f \u043c\u043e\u0435\u0439 \u0434\u043e\u043c\u0430\u0448\u043d\u0435\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c \u0432 ~111GB \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f \u0432\u0441\u0435\u0433\u043e \u0432 20GB. \u041f\u0440\u0438 \u043f\u0435\u0440\u0432\u043e\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043e\u043d \u0434\u0435\u043b\u0430\u0435\u0442 \u043f\u043e\u043b\u043d\u044b\u0439 \u0441\u043d\u0430\u043f\u0448\u043e\u0442 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438, \u043f\u0440\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0443\u0436\u0435 \u0431\u044d\u043a\u0430\u043f\u0438\u0442 \u0434\u0435\u043b\u044c\u0442\u0443 \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u0441\u043d\u0430\u043f\u0448\u043e\u0442\u0430\u043c\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f. \u0421\u043d\u0430\u043f\u0448\u043e\u0442 &#8212; \u044d\u0442\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438.<\/p>\n<h3>MinIO<\/h3>\n<p>\u0411\u044d\u043a\u0430\u043f\u044b \u043d\u0443\u0436\u043d\u043e \u0433\u0434\u0435-\u0442\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c, \u044f \u0432\u044b\u0431\u0440\u0430\u043b \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e S3 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 <a href=\"https:\/\/github.com\/minio\/minio\" rel=\"noopener noreferrer nofollow\">MinIO<\/a>. \u0415\u0433\u043e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043b\u0435\u0433\u043a\u043e \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u043d\u0430 \u0441\u0432\u043e\u0435\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435, \u0432 \u0432\u0435\u0431-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435 \u043d\u0435\u0441\u043b\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u044d\u0442\u043e <strong>production ready<\/strong> \u0440\u0435\u0448\u0435\u043d\u0438\u0435, \u0435\u0433\u043e \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0432\u043e \u043c\u043d\u043e\u0433\u0438\u0445 \u043a\u0440\u0443\u043f\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<h3>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430<\/h3>\n<p>\u0421\u043a\u0430\u0447\u0430\u0442\u044c restic \u043c\u043e\u0436\u043d\u043e \u0438\u0437 <a href=\"https:\/\/github.com\/restic\/restic\/releases\" rel=\"noopener noreferrer nofollow\">github \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f<\/a> \u0438\u043b\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0430\u043a\u0435\u0442\u043d\u043e\u0433\u043e \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u0430 \u0432\u0430\u0448\u0435\u0439 \u041e\u0421.<\/p>\n<p>\u0412 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439:<\/p>\n<pre><code class=\"bash\">restic -r RESTIC_REPOSITORY init<\/code><\/pre>\n<p>\u0420\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0435\u043c \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f \u0438\u043b\u0438 \u0430\u0434\u0440\u0435\u0441 \u043e\u0431\u043b\u0430\u0447\u043d\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 \u0434\u0435\u043b\u0430\u0442\u044c \u0431\u044d\u043a\u0430\u043f \u043f\u0440\u044f\u043c\u043e \u043d\u0430 \u0442\u043e\u043c \u0436\u0435 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435 \u0432 \u043f\u0430\u043f\u043a\u0443 <code>backup-repo<\/code>, \u0442\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<pre><code class=\"bash\">restic -r \/home\/backup-repo init enter password for new repository: enter password again:<\/code><\/pre>\n<p>restic \u043f\u043e\u043f\u0440\u043e\u0441\u0438\u0442\u044c \u0432\u0432\u0435\u0441\u0442\u0438 \u043f\u0430\u0440\u043e\u043b\u044c \u043e\u0442 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f, \u043f\u0430\u0440\u043e\u043b\u044c \u0442\u0435\u0440\u044f\u0442\u044c \u043d\u0435\u043b\u044c\u0437\u044f, \u0438\u043d\u0430\u0447\u0435 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0434\u0430\u043d\u043d\u044b\u043c \u0431\u0443\u0434\u0443\u0442 \u0443\u0442\u0435\u0440\u044f\u043d.<\/p>\n<p>\u041a\u043e\u043c\u0430\u043d\u0434\u0430 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0431\u044d\u043a\u0430\u043f\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"bash\">restic -r \/home\/backup-repo --verbose backup \/documents<\/code><\/pre>\n<p>\u0424\u043b\u0430\u0433 <code>--verbose<\/code> \u043d\u0443\u0436\u0435\u043d \u0434\u043b\u044f \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0433\u043e \u0432\u044b\u0432\u043e\u0434\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438. \u042d\u0442\u043e\u0439 \u043a\u043e\u043c\u043c\u0430\u043d\u0434\u043e\u0439 \u043c\u044b \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043b\u0438 \u0431\u044d\u043a\u0430\u043f \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 <code>documents<\/code> \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e  <code>backup-repo<\/code>.<\/p>\n<p>\u0412\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u0431\u044d\u043a\u0430\u043f\u0430 \u043c\u043e\u0436\u043d\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439:<\/p>\n<pre><code class=\"bash\">restic -r \/home\/backup-repo restore latest --target \/restore_folder<\/code><\/pre>\n<p><code>latest<\/code> &#8212; \u044d\u0442\u043e \u0441\u0430\u043c\u044b\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0441\u043d\u0430\u043f\u0448\u043e\u0442, \u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c id \u043d\u0443\u0436\u043d\u043e\u0433\u043e \u0441\u043d\u0430\u043f\u0448\u043e\u0442\u0430, \u0435\u0441\u043b\u0438 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f. restic \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u0438 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u0441\u043b\u0435 \u0444\u043b\u0430\u0433\u0430 <code>--path<\/code> \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0443\u0436\u043d\u044b\u0439 \u043f\u0443\u0442\u044c.<\/p>\n<p>\u0420\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c MinIO \u0443\u0434\u043e\u0431\u043d\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u0432 docker \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 \u043d\u0430 \u0432\u0430\u0448\u0435\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435:<\/p>\n<pre><code class=\"bash\">docker run \\    -p 9000:9000 \\    -p 9090:9090 \\    --name minio \\    -v \/mnt\/my-storage:\/data \\    -e \"MINIO_ROOT_USER=ROOTNAME\" \\    -e \"MINIO_ROOT_PASSWORD=CHANGEME123\" \\    quay.io\/minio\/minio server \/data --console-address \":9090\"<\/code><\/pre>\n<ul>\n<li>\n<p><code>-p<\/code> \u043f\u0440\u043e\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u0442 \u043f\u043e\u0440\u0442\u044b \u043c\u0435\u0436\u0434\u0443 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u043c \u0438 \u043c\u0430\u0448\u0438\u043d\u043e\u0439 \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043e\u043d \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f.<\/p>\n<\/li>\n<li>\n<p><code>9000<\/code> \u043f\u043e\u0440\u0442 \u0441\u0430\u043c\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430, <code>9090<\/code> \u043f\u043e\u0440\u0442 \u0432\u0435\u0431-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430.<\/p>\n<\/li>\n<li>\n<p><code>-v<\/code> \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u0443\u0434\u0443\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u0445\u043e\u0441\u0442\u043e\u0432\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435, \u0441\u0435\u0440\u0432\u0438\u0441 \u0431\u0443\u0434\u0435\u0442 \u0437\u0435\u0440\u043a\u0430\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e <code>\/data<\/code>.<\/p>\n<\/li>\n<li>\n<p><code>-e<\/code> \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f, \u043d\u0443\u0436\u043d\u044b \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0432\u0435\u0431-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0443.<\/p>\n<\/li>\n<li>\n<p><code>--console-address<\/code> \u0430\u0434\u0440\u0435\u0441 \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0432\u0435\u0431-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441.<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 MinIO \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u0439\u0442\u0438 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u0438 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u043b\u044e\u0447 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 (access key), \u0447\u0442\u043e\u0431\u044b restic \u043c\u043e\u0433 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c\u0441\u044f \u043a \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0443.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0431\u044d\u043a\u0430\u043f \u0432 MinIO:<\/p>\n<pre><code class=\"bash\"># \u0437\u0430\u0434\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0441 ID \u0438 SECRET, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0440\u0430\u043d\u0435\u0435 \u0432 \u0432\u0435\u0431-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435 export AWS_ACCESS_KEY_ID=my_key_id export AWS_SECRET_ACCESS_KEY=my_key_secret  # \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043d\u043e\u0432\u044b\u0439 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0438 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043f\u0430\u0440\u043e\u043b\u044c restic -r s3:http:\/\/localhost:9000\/backup-repo init enter password for new repository: enter password again:  # \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0431\u044d\u043a\u0430\u043f\u0430 restic backup -r s3:http:\/\/localhost:9000\/backup-repo --verbose \/documents<\/code><\/pre>\n<p>\u0412\u043c\u0435\u0441\u0442\u043e <code>http:\/\/localhost:9000<\/code> \u0431\u0443\u0434\u0435\u0442 \u0432\u0430\u0448 \u0430\u0434\u0440\u0435\u0441 \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043f\u043e\u0434\u043d\u044f\u0442 MinIO.<\/p>\n<p>\u0412 \u0446\u0435\u043b\u043e\u043c \u0442\u0430\u043a \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0440\u0435\u0437\u0435\u0440\u0432\u043d\u043e\u0435 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441 restic \u0438 MinIO, \u043d\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u0434\u0435\u043d\u044c \u0434\u0435\u043b\u0430\u0442\u044c \u0431\u044d\u043a\u0430\u043f\u044b \u0440\u0443\u043a\u0430\u043c\u0438 \u0431\u044b\u0441\u0442\u0440\u043e \u043d\u0430\u0434\u043e\u0435\u0441\u0442, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043d\u0443\u0436\u043d\u043e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0431\u044d\u043a\u0430\u043f\u0430 \u0431\u044b\u043b \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0430\u0432\u0442\u043e\u043d\u043e\u043c\u043d\u044b\u043c.<\/p>\n<h3>systemd<\/h3>\n<p>\u042f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 sytstemd \u0434\u043b\u044f \u044d\u0442\u0438\u0445 \u0446\u0435\u043b\u0435\u0439, \u043d\u043e \u0432\u043c\u0435\u0441\u0442\u043e systemd \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c cron \u043d\u0430 Linux \u0438\u043b\u0438 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a \u0437\u0430\u0434\u0430\u043d\u0438\u0439 \u043d\u0430 Windows \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u043f\u043e \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u0438\u044e.<\/p>\n<p>\u0412 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0444\u0430\u0439\u043b \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0431\u0443\u0434\u0443\u0442 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b restic <code>~\/.config\/restic-backup.conf<\/code><\/p>\n<pre><code class=\"bash\"># ID \u0438 SECRET MinIO AWS_ACCESS_KEY_ID=my_key_id AWS_SECRET_ACCESS_KEY=my_key_secret # \u0430\u0434\u0440\u0435\u0441 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f MinIO RESTIC_REPOSITORY=s3:http:\/\/localhost:9000\/backup-repo # \u043f\u0430\u0440\u043e\u043b\u044c \u043e\u0442 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f RESTIC_PASSWORD=restic_pass # \u043f\u0443\u0442\u044c \u043a \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0431\u044d\u043a\u0430\u043f\u0438\u043c BACKUP_PATH=\"\/documents\" # \u0437\u0430 \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u043d\u0435\u0439 \u043d\u0443\u0436\u043d\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0431\u044d\u043a\u0430\u043f\u044b RETENTION_DAYS=7<\/code><\/pre>\n<p>\u0418 \u0441\u0430\u043c \u0444\u0430\u0439\u043b \u0441\u0435\u0440\u0432\u0438\u0441\u0430 systemd <code>~\/.config\/systemd\/user\/restic-backup.service<\/code><\/p>\n<pre><code class=\"bash\">[Unit] Description=Restic backup service [Service] Type=oneshot ExecStart=restic backup --verbose $BACKUP_PATH ExecStartPost=restic forget --verbose --keep-daily $RETENTION_DAYS EnvironmentFile=%h\/.config\/restic-backup.conf<\/code><\/pre>\n<p>\u041a\u043e\u043c\u043c\u0430\u043d\u0434\u0430 <code>forget<\/code> \u043d\u0443\u0436\u043d\u0430 \u0434\u043b\u044f \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u0441\u0442\u0430\u0440\u044b\u0445 \u0441\u043d\u0430\u043f\u0448\u043e\u0442\u043e\u0432, \u0444\u043b\u0430\u0433 <code>--keep-daily<\/code> \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0443 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0441\u043d\u0430\u043f\u0448\u043e\u0442\u043e\u0432 \u0442.\u0435. \u0437\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 n \u0434\u043d\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u043c\u0435\u044e\u0442 \u043e\u0434\u0438\u043d \u0438\u043b\u0438 \u0431\u043e\u043b\u0435\u0435 \u0441\u043d\u0430\u043f\u0448\u043e\u0442\u043e\u0432, \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0430\u043c\u044b\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0434\u043d\u044f. <code>forget<\/code> \u0443\u0434\u0430\u043b\u044f\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043d\u0430\u043f\u0448\u043e\u0442\u044b, \u043d\u043e \u043d\u0435 \u0441\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0435.<\/p>\n<p>\u0414\u043b\u044f \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0435\u0440\u0432\u0438\u0441. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0435\u0442 \u0432\u043e\u043f\u0440\u043e\u0441, \u0430 \u043f\u043e\u0447\u0435\u043c\u0443 \u043d\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c <code>prune<\/code> \u0432 \u043f\u0435\u0440\u0432\u044b\u0439 \u0441\u0435\u0440\u0432\u0438\u0441, \u043c\u043e\u0436\u043d\u043e \u0438 \u0442\u0430\u043a, \u043d\u043e \u0434\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c\u0441\u044f \u0441 \u0440\u0430\u0437\u043d\u043e\u0439 \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u043d\u043e\u0441\u0442\u044c\u044e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u043d\u0438 \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u044b \u043d\u0430 \u0434\u0432\u0430 \u0441\u0435\u0440\u0432\u0438\u0441\u0430.<\/p>\n<p>\u0412\u0442\u043e\u0440\u043e\u0439 \u0441\u0435\u0440\u0432\u0438\u0441 <code>~\/.config\/systemd\/user\/restic-prune.service<\/code><\/p>\n<pre><code class=\"bash\">[Unit] Description=Restic backup service (data pruning) [Service] Type=oneshot ExecStart=restic prune EnvironmentFile=%h\/.config\/restic-backup.conf<\/code><\/pre>\n<p>\u041a\u043e\u043c\u0430\u043d\u0434\u0430 <code>prune<\/code> \u0431\u0443\u0434\u0435\u0442 \u043e\u0447\u0438\u0449\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0441\u044b\u043b\u0430\u044e\u0442\u0441\u044f \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0435 \u0441\u043d\u0430\u043f\u0448\u043e\u0442\u044b.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0442\u0430\u0439\u043c\u0435\u0440\u044b \u0434\u043b\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0432 \u0442\u043e\u0439 \u0436\u0435 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438.<\/p>\n<p><code>~\/.config\/systemd\/user\/restic-backup.timer<\/code><\/p>\n<pre><code class=\"bash\">[Unit] Description=Backup with restic daily [Timer] OnCalendar=daily Persistent=true [Install] WantedBy=timers.target<\/code><\/pre>\n<p><code>OnCalendar<\/code> \u0437\u0430\u0434\u0430\u0435\u0442 \u0432\u0440\u0435\u043c\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430, \u0443 \u043c\u0435\u043d\u044f \u0441\u0435\u0440\u0432\u0438\u0441 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0435\u0436\u0435\u0434\u043d\u0435\u0432\u043d\u043e \u0432 12 \u043d\u043e\u0447\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u0442\u043e\u0438\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>daily<\/code>.<\/p>\n<p><code>~\/.config\/systemd\/user\/restic-prune.timer<\/code><\/p>\n<pre><code class=\"bash\">[Unit] Description=Prune data from the restic repository monthly [Timer] # This will run on the 1st of every month at 2AM OnCalendar=*-*-01 02:00:00 Persistent=true [Install] WantedBy=timers.target<\/code><\/pre>\n<p>\u0421\u0435\u0440\u0432\u0438\u0441 \u0434\u043b\u044f \u043e\u0447\u0438\u0441\u0442\u043a\u0438 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c\u0441\u044f \u0440\u0430\u0437 \u0432 \u043c\u0435\u0441\u044f\u0446, \u043a\u0430\u0436\u0434\u043e\u0435 \u043f\u0435\u0440\u0432\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u0432 2 \u0447\u0430\u0441\u0430 \u043d\u043e\u0447\u0438 . \u042f \u0443\u043a\u0430\u0437\u0430\u043b 2 \u0447\u0430\u0441\u0430 \u043d\u043e\u0447\u0438, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0431\u044b\u043b\u043e \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u0430 \u0443 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0441 \u0434\u043e\u0441\u0442\u0443\u043f\u043e\u043c \u043a \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044e.<\/p>\n<p>\u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043c\u0435\u043d\u0434\u0436\u0435\u0440 systemd, \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u0438 \u043f\u043e\u0434\u0445\u0432\u0430\u0442\u0438\u043b\u0438\u0441\u044c:<\/p>\n<pre><code class=\"bash\">systemctl --user daemon-reload<\/code><\/pre>\n<p>\u0418 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0442\u0430\u0439\u043c\u0435\u0440\u044b:<\/p>\n<pre><code class=\"bash\">systemctl --user enable --now restic-backup.timer systemctl --user enable --now restic-prune.timer<\/code><\/pre>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u0432\u0441\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u044b \u0438 \u0435\u0441\u043b\u0438 \u0432\u0441\u0435 \u0441\u0434\u0435\u043b\u0430\u043d\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e restic \u0431\u0443\u0434\u0435\u0442 \u0434\u0435\u043b\u0430\u0442\u044c \u0435\u0436\u0435\u0434\u043d\u0435\u0432\u043d\u044b\u0435 \u0431\u044d\u043a\u0430\u043f\u044b \u0438 \u043e\u0447\u0438\u0449\u0430\u0442\u044c \u0441\u0442\u0430\u0440\u044b\u0435 \u0440\u0430\u0437 \u0432 \u043c\u0435\u0441\u044f\u0446. \u0412\u043c\u0435\u0441\u0442\u043e MinIO \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043b\u044e\u0431\u043e\u0435 \u0434\u0440\u0443\u0433\u043e\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435, \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u044b\u0445 restic&#8217;\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c <a href=\"https:\/\/restic.readthedocs.io\/en\/stable\/030_preparing_a_new_repo.html\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<h3>\u041f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u0441\u0441\u044b\u043b\u043a\u0438<\/h3>\n<p><a href=\"https:\/\/restic.readthedocs.io\/en\/stable\/index.html\" rel=\"noopener noreferrer nofollow\">Restic Documentation<\/a><br \/><a href=\"https:\/\/min.io\/docs\/minio\/container\/index.html\" rel=\"noopener noreferrer nofollow\">MinIO docker install documentation<\/a><br \/><a href=\"https:\/\/www.freedesktop.org\/software\/systemd\/man\/systemd.service.html\" rel=\"noopener noreferrer nofollow\">systemd service<\/a><br \/><a href=\"https:\/\/www.freedesktop.org\/software\/systemd\/man\/systemd.timer.html\" rel=\"noopener noreferrer nofollow\">systemd timer<\/a><\/p>\n<\/div>\n<\/div>\n<p> <!----> <!----><\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/739698\/\"> https:\/\/habr.com\/ru\/articles\/739698\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<p>\u0414\u043e \u043d\u0435\u0434\u0430\u0432\u043d\u0435\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u044f \u0434\u0435\u043b\u0430\u043b \u0431\u044d\u043a\u0430\u043f\u044b \u0441\u0432\u043e\u0438\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 \u043d\u0430 \u0432\u043d\u0435\u0448\u043d\u0438\u0439 HDD. \u0422\u0430\u043a\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043c\u0435\u043d\u044f \u0443\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u043b \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0431\u044d\u043a\u0430\u043f\u0438\u043b \u0434\u0430\u043d\u043d\u044b\u0435 \u0440\u0435\u0434\u043a\u043e &#8212; \u0440\u0430\u0437 \u0432 \u043d\u0435\u0434\u0435\u043b\u044e. \u041a\u043e\u0433\u0434\u0430 \u0437\u0430\u0434\u0443\u043c\u0430\u043b\u0441\u044f \u043e \u0435\u0436\u0435\u0434\u043d\u0435\u0432\u043d\u044b\u0445 \u0431\u044d\u043a\u0430\u043f\u0430\u0445, \u043f\u043e\u043d\u044f\u043b, \u0447\u0442\u043e \u0431\u0435\u0433\u0430\u0442\u044c \u0441 \u0432\u043d\u0435\u0448\u043d\u0438\u043c HDD \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u043f\u0440\u0430\u043a\u0442\u0438\u0447\u043d\u043e. \u0425\u043e\u0447\u0443 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u0440\u043e \u0443\u0434\u043e\u0431\u043d\u043e\u0435 (\u043f\u043e \u043a\u0440\u0430\u0439\u043d\u0435\u0439 \u043c\u0435\u0440\u0435 \u0434\u043b\u044f \u043c\u0435\u043d\u044f) \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0435\u0436\u0435\u0434\u043d\u0435\u0432\u043d\u044b\u0445 \u0431\u0435\u043a\u0430\u043f\u043e\u0432 \u0431\u0435\u0437 \u043f\u0440\u043e\u0432\u043e\u0434\u043e\u0432.<\/p>\n<h3>restic<\/h3>\n<p>\u0414\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u0430\u043c\u0438\u0445 \u0431\u044d\u043a\u0430\u043f\u043e\u0432 \u044f \u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0441\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043e\u0439 <a href=\"https:\/\/github.com\/restic\/restic\" rel=\"noopener noreferrer nofollow\">restic<\/a>. \u042d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u0430\u044f CLI \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430, \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 \u0432\u0441\u0435\u0445 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u041e\u0421 \u0442.\u043a \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0430 \u043d\u0430 Go. \u041f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0434\u0435\u043b\u0430\u0442\u044c \u0431\u044d\u043a\u0430\u043f\u044b \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e, \u043d\u0430 \u0432\u043d\u0435\u0448\u043d\u0438\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0438 \u0432 \u043e\u0431\u043b\u0430\u0447\u043d\u044b\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438. \u0414\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u0441\u0436\u0438\u043c\u0430\u0435\u0442 \u0444\u0430\u0439\u043b\u044b, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0431\u044d\u043a\u0430\u043f \u043c\u043e\u0435\u0439 \u0434\u043e\u043c\u0430\u0448\u043d\u0435\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c \u0432 ~111GB \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f \u0432\u0441\u0435\u0433\u043e \u0432 20GB. \u041f\u0440\u0438 \u043f\u0435\u0440\u0432\u043e\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043e\u043d \u0434\u0435\u043b\u0430\u0435\u0442 \u043f\u043e\u043b\u043d\u044b\u0439 \u0441\u043d\u0430\u043f\u0448\u043e\u0442 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438, \u043f\u0440\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0443\u0436\u0435 \u0431\u044d\u043a\u0430\u043f\u0438\u0442 \u0434\u0435\u043b\u044c\u0442\u0443 \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u0441\u043d\u0430\u043f\u0448\u043e\u0442\u0430\u043c\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f. \u0421\u043d\u0430\u043f\u0448\u043e\u0442 &#8212; \u044d\u0442\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438.<\/p>\n<h3>MinIO<\/h3>\n<p>\u0411\u044d\u043a\u0430\u043f\u044b \u043d\u0443\u0436\u043d\u043e \u0433\u0434\u0435-\u0442\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c, \u044f \u0432\u044b\u0431\u0440\u0430\u043b \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e S3 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 <a href=\"https:\/\/github.com\/minio\/minio\" rel=\"noopener noreferrer nofollow\">MinIO<\/a>. \u0415\u0433\u043e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043b\u0435\u0433\u043a\u043e \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u043d\u0430 \u0441\u0432\u043e\u0435\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435, \u0432 \u0432\u0435\u0431-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435 \u043d\u0435\u0441\u043b\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u044d\u0442\u043e <strong>production ready<\/strong> \u0440\u0435\u0448\u0435\u043d\u0438\u0435, \u0435\u0433\u043e \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0432\u043e \u043c\u043d\u043e\u0433\u0438\u0445 \u043a\u0440\u0443\u043f\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<h3>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430<\/h3>\n<p>\u0421\u043a\u0430\u0447\u0430\u0442\u044c restic \u043c\u043e\u0436\u043d\u043e \u0438\u0437 <a href=\"https:\/\/github.com\/restic\/restic\/releases\" rel=\"noopener noreferrer nofollow\">github \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f<\/a> \u0438\u043b\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0430\u043a\u0435\u0442\u043d\u043e\u0433\u043e \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u0430 \u0432\u0430\u0448\u0435\u0439 \u041e\u0421.<\/p>\n<p>\u0412 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439:<\/p>\n<pre><code class=\"bash\">restic -r RESTIC_REPOSITORY init<\/code><\/pre>\n<p>\u0420\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0435\u043c \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f \u0438\u043b\u0438 \u0430\u0434\u0440\u0435\u0441 \u043e\u0431\u043b\u0430\u0447\u043d\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 \u0434\u0435\u043b\u0430\u0442\u044c \u0431\u044d\u043a\u0430\u043f \u043f\u0440\u044f\u043c\u043e \u043d\u0430 \u0442\u043e\u043c \u0436\u0435 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435 \u0432 \u043f\u0430\u043f\u043a\u0443 <code>backup-repo<\/code>, \u0442\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<pre><code class=\"bash\">restic -r \/home\/backup-repo init enter password for new repository: enter password again:<\/code><\/pre>\n<p>restic \u043f\u043e\u043f\u0440\u043e\u0441\u0438\u0442\u044c \u0432\u0432\u0435\u0441\u0442\u0438 \u043f\u0430\u0440\u043e\u043b\u044c \u043e\u0442 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f, \u043f\u0430\u0440\u043e\u043b\u044c \u0442\u0435\u0440\u044f\u0442\u044c \u043d\u0435\u043b\u044c\u0437\u044f, \u0438\u043d\u0430\u0447\u0435 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0434\u0430\u043d\u043d\u044b\u043c \u0431\u0443\u0434\u0443\u0442 \u0443\u0442\u0435\u0440\u044f\u043d.<\/p>\n<p>\u041a\u043e\u043c\u0430\u043d\u0434\u0430 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0431\u044d\u043a\u0430\u043f\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"bash\">restic -r \/home\/backup-repo --verbose backup \/documents<\/code><\/pre>\n<p>\u0424\u043b\u0430\u0433 <code>--verbose<\/code> \u043d\u0443\u0436\u0435\u043d \u0434\u043b\u044f \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0433\u043e \u0432\u044b\u0432\u043e\u0434\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438. \u042d\u0442\u043e\u0439 \u043a\u043e\u043c\u043c\u0430\u043d\u0434\u043e\u0439 \u043c\u044b \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043b\u0438 \u0431\u044d\u043a\u0430\u043f \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 <code>documents<\/code> \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e  <code>backup-repo<\/code>.<\/p>\n<p>\u0412\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u0431\u044d\u043a\u0430\u043f\u0430 \u043c\u043e\u0436\u043d\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439:<\/p>\n<pre><code class=\"bash\">restic -r \/home\/backup-repo restore latest --target \/restore_folder<\/code><\/pre>\n<p><code>latest<\/code> &#8212; \u044d\u0442\u043e \u0441\u0430\u043c\u044b\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0441\u043d\u0430\u043f\u0448\u043e\u0442, \u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c id \u043d\u0443\u0436\u043d\u043e\u0433\u043e \u0441\u043d\u0430\u043f\u0448\u043e\u0442\u0430, \u0435\u0441\u043b\u0438 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f. restic \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u0438 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u0441\u043b\u0435 \u0444\u043b\u0430\u0433\u0430 <code>--path<\/code> \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0443\u0436\u043d\u044b\u0439 \u043f\u0443\u0442\u044c.<\/p>\n<p>\u0420\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c MinIO \u0443\u0434\u043e\u0431\u043d\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u0432 docker \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 \u043d\u0430 \u0432\u0430\u0448\u0435\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435:<\/p>\n<pre><code class=\"bash\">docker run \\    -p 9000:9000 \\    -p 9090:9090 \\    --name minio \\    -v \/mnt\/my-storage:\/data \\    -e \"MINIO_ROOT_USER=ROOTNAME\" \\    -e \"MINIO_ROOT_PASSWORD=CHANGEME123\" \\    quay.io\/minio\/minio server \/data --console-address \":9090\"<\/code><\/pre>\n<ul>\n<li>\n<p><code>-p<\/code> \u043f\u0440\u043e\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u0442 \u043f\u043e\u0440\u0442\u044b \u043c\u0435\u0436\u0434\u0443 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u043c \u0438 \u043c\u0430\u0448\u0438\u043d\u043e\u0439 \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043e\u043d \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f.<\/p>\n<\/li>\n<li>\n<p><code>9000<\/code> \u043f\u043e\u0440\u0442 \u0441\u0430\u043c\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430, <code>9090<\/code> \u043f\u043e\u0440\u0442 \u0432\u0435\u0431-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430.<\/p>\n<\/li>\n<li>\n<p><code>-v<\/code> \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u0443\u0434\u0443\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u0445\u043e\u0441\u0442\u043e\u0432\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435, \u0441\u0435\u0440\u0432\u0438\u0441 \u0431\u0443\u0434\u0435\u0442 \u0437\u0435\u0440\u043a\u0430\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e <code>\/data<\/code>.<\/p>\n<\/li>\n<li>\n<p><code>-e<\/code> \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f, \u043d\u0443\u0436\u043d\u044b \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0432\u0435\u0431-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0443.<\/p>\n<\/li>\n<li>\n<p><code>--console-address<\/code> \u0430\u0434\u0440\u0435\u0441 \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0432\u0435\u0431-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441.<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 MinIO \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u0439\u0442\u0438 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u0438 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u043b\u044e\u0447 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 (access key), \u0447\u0442\u043e\u0431\u044b restic \u043c\u043e\u0433 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c\u0441\u044f \u043a \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0443.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0431\u044d\u043a\u0430\u043f \u0432 MinIO:<\/p>\n<pre><code class=\"bash\"># \u0437\u0430\u0434\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0441 ID \u0438 SECRET, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0440\u0430\u043d\u0435\u0435 \u0432 \u0432\u0435\u0431-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435 export AWS_ACCESS_KEY_ID=my_key_id export AWS_SECRET_ACCESS_KEY=my_key_secret  # \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043d\u043e\u0432\u044b\u0439 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0438 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043f\u0430\u0440\u043e\u043b\u044c restic -r s3:http:\/\/localhost:9000\/backup-repo init enter password for new repository: enter password again:  # \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0431\u044d\u043a\u0430\u043f\u0430 restic backup -r s3:http:\/\/localhost:9000\/backup-repo --verbose \/documents<\/code><\/pre>\n<p>\u0412\u043c\u0435\u0441\u0442\u043e <code>http:\/\/localhost:9000<\/code> \u0431\u0443\u0434\u0435\u0442 \u0432\u0430\u0448 \u0430\u0434\u0440\u0435\u0441 \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043f\u043e\u0434\u043d\u044f\u0442 MinIO.<\/p>\n<p>\u0412 \u0446\u0435\u043b\u043e\u043c \u0442\u0430\u043a \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0440\u0435\u0437\u0435\u0440\u0432\u043d\u043e\u0435 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441 restic \u0438 MinIO, \u043d\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u0434\u0435\u043d\u044c \u0434\u0435\u043b\u0430\u0442\u044c \u0431\u044d\u043a\u0430\u043f\u044b \u0440\u0443\u043a\u0430\u043c\u0438 \u0431\u044b\u0441\u0442\u0440\u043e \u043d\u0430\u0434\u043e\u0435\u0441\u0442, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043d\u0443\u0436\u043d\u043e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0431\u044d\u043a\u0430\u043f\u0430 \u0431\u044b\u043b \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0430\u0432\u0442\u043e\u043d\u043e\u043c\u043d\u044b\u043c.<\/p>\n<h3>systemd<\/h3>\n<p>\u042f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 sytstemd \u0434\u043b\u044f \u044d\u0442\u0438\u0445 \u0446\u0435\u043b\u0435\u0439, \u043d\u043e \u0432\u043c\u0435\u0441\u0442\u043e systemd \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c cron \u043d\u0430 Linux \u0438\u043b\u0438 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a \u0437\u0430\u0434\u0430\u043d\u0438\u0439 \u043d\u0430 Windows \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u043f\u043e \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u0438\u044e.<\/p>\n<p>\u0412 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0444\u0430\u0439\u043b \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0431\u0443\u0434\u0443\u0442 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b restic <code>~\/.config\/restic-backup.conf<\/code><\/p>\n<pre><code class=\"bash\"># ID \u0438 SECRET MinIO AWS_ACCESS_KEY_ID=my_key_id AWS_SECRET_ACCESS_KEY=my_key_secret # \u0430\u0434\u0440\u0435\u0441 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f MinIO RESTIC_REPOSITORY=s3:http:\/\/localhost:9000\/backup-repo # \u043f\u0430\u0440\u043e\u043b\u044c \u043e\u0442 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f RESTIC_PASSWORD=restic_pass # \u043f\u0443\u0442\u044c \u043a \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0431\u044d\u043a\u0430\u043f\u0438\u043c BACKUP_PATH=\"\/documents\" # \u0437\u0430 \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u043d\u0435\u0439 \u043d\u0443\u0436\u043d\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0431\u044d\u043a\u0430\u043f\u044b RETENTION_DAYS=7<\/code><\/pre>\n<p>\u0418 \u0441\u0430\u043c \u0444\u0430\u0439\u043b \u0441\u0435\u0440\u0432\u0438\u0441\u0430 systemd <code>~\/.config\/systemd\/user\/restic-backup.service<\/code><\/p>\n<pre><code class=\"bash\">[Unit] Description=Restic backup service [Service] Type=oneshot ExecStart=restic backup --verbose $BACKUP_PATH ExecStartPost=restic forget --verbose --keep-daily $RETENTION_DAYS EnvironmentFile=%h\/.config\/restic-backup.conf<\/code><\/pre>\n<p>\u041a\u043e\u043c\u043c\u0430\u043d\u0434\u0430 <code>forget<\/code> \u043d\u0443\u0436\u043d\u0430 \u0434\u043b\u044f \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u0441\u0442\u0430\u0440\u044b\u0445 \u0441\u043d\u0430\u043f\u0448\u043e\u0442\u043e\u0432, \u0444\u043b\u0430\u0433 <code>--keep-daily<\/code> \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0443 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0441\u043d\u0430\u043f\u0448\u043e\u0442\u043e\u0432 \u0442.\u0435. \u0437\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 n \u0434\u043d\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u043c\u0435\u044e\u0442 \u043e\u0434\u0438\u043d \u0438\u043b\u0438 \u0431\u043e\u043b\u0435\u0435 \u0441\u043d\u0430\u043f\u0448\u043e\u0442\u043e\u0432, \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0430\u043c\u044b\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0434\u043d\u044f. <code>forget<\/code> \u0443\u0434\u0430\u043b\u044f\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043d\u0430\u043f\u0448\u043e\u0442\u044b, \u043d\u043e \u043d\u0435 \u0441\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0435.<\/p>\n<p>\u0414\u043b\u044f \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0435\u0440\u0432\u0438\u0441. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0435\u0442 \u0432\u043e\u043f\u0440\u043e\u0441, \u0430 \u043f\u043e\u0447\u0435\u043c\u0443 \u043d\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c <code>prune<\/code> \u0432 \u043f\u0435\u0440\u0432\u044b\u0439 \u0441\u0435\u0440\u0432\u0438\u0441, \u043c\u043e\u0436\u043d\u043e \u0438 \u0442\u0430\u043a, \u043d\u043e \u0434\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c\u0441\u044f \u0441 \u0440\u0430\u0437\u043d\u043e\u0439 \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u043d\u043e\u0441\u0442\u044c\u044e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u043d\u0438 \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u044b \u043d\u0430 \u0434\u0432\u0430 \u0441\u0435\u0440\u0432\u0438\u0441\u0430.<\/p>\n<p>\u0412\u0442\u043e\u0440\u043e\u0439 \u0441\u0435\u0440\u0432\u0438\u0441 <code>~\/.config\/systemd\/user\/restic-prune.service<\/code><\/p>\n<pre><code class=\"bash\">[Unit] Description=Restic backup service (data pruning) [Service] Type=oneshot ExecStart=restic prune EnvironmentFile=%h\/.config\/restic-backup.conf<\/code><\/pre>\n<p>\u041a\u043e\u043c\u0430\u043d\u0434\u0430 <code>prune<\/code> \u0431\u0443\u0434\u0435\u0442 \u043e\u0447\u0438\u0449\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0441\u044b\u043b\u0430\u044e\u0442\u0441\u044f \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0435 \u0441\u043d\u0430\u043f\u0448\u043e\u0442\u044b.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0442\u0430\u0439\u043c\u0435\u0440\u044b \u0434\u043b\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0432 \u0442\u043e\u0439 \u0436\u0435 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438.<\/p>\n<p><code>~\/.config\/systemd\/user\/restic-backup.timer<\/code><\/p>\n<pre><code class=\"bash\">[Unit] Description=Backup with restic daily [Timer] OnCalendar=daily Persistent=true [Install] WantedBy=timers.target<\/code><\/pre>\n<p><code>OnCalendar<\/code> \u0437\u0430\u0434\u0430\u0435\u0442 \u0432\u0440\u0435\u043c\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430, \u0443 \u043c\u0435\u043d\u044f \u0441\u0435\u0440\u0432\u0438\u0441 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0435\u0436\u0435\u0434\u043d\u0435\u0432\u043d\u043e \u0432 12 \u043d\u043e\u0447\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u0442\u043e\u0438\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>daily<\/code>.<\/p>\n<p><code>~\/.config\/systemd\/user\/restic-prune.timer<\/code><\/p>\n<pre><code class=\"bash\">[Unit] Description=Prune data from the restic repository monthly [Timer] # This will run on the 1st of every month at 2AM OnCalendar=*-*-01 02:00:00 Persistent=true [Install] WantedBy=timers.target<\/code><\/pre>\n<p>\u0421\u0435\u0440\u0432\u0438\u0441 \u0434\u043b\u044f \u043e\u0447\u0438\u0441\u0442\u043a\u0438 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c\u0441\u044f \u0440\u0430\u0437 \u0432 \u043c\u0435\u0441\u044f\u0446, \u043a\u0430\u0436\u0434\u043e\u0435 \u043f\u0435\u0440\u0432\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u0432 2 \u0447\u0430\u0441\u0430 \u043d\u043e\u0447\u0438 . \u042f \u0443\u043a\u0430\u0437\u0430\u043b 2 \u0447\u0430\u0441\u0430 \u043d\u043e\u0447\u0438, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0431\u044b\u043b\u043e \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u0430 \u0443 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0441 \u0434\u043e\u0441\u0442\u0443\u043f\u043e\u043c \u043a \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044e.<\/p>\n<p>\u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043c\u0435\u043d\u0434\u0436\u0435\u0440 systemd, \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u0438 \u043f\u043e\u0434\u0445\u0432\u0430\u0442\u0438\u043b\u0438\u0441\u044c:<\/p>\n<pre><code class=\"bash\">systemctl --user daemon-reload<\/code><\/pre>\n<p>\u0418 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0442\u0430\u0439\u043c\u0435\u0440\u044b:<\/p>\n<pre><code class=\"bash\">systemctl --user enable --now restic-backup.timer systemctl --user enable --now restic-prune.timer<\/code><\/pre>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u0432\u0441\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u044b \u0438 \u0435\u0441\u043b\u0438 \u0432\u0441\u0435 \u0441\u0434\u0435\u043b\u0430\u043d\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e restic \u0431\u0443\u0434\u0435\u0442 \u0434\u0435\u043b\u0430\u0442\u044c \u0435\u0436\u0435\u0434\u043d\u0435\u0432\u043d\u044b\u0435 \u0431\u044d\u043a\u0430\u043f\u044b \u0438 \u043e\u0447\u0438\u0449\u0430\u0442\u044c \u0441\u0442\u0430\u0440\u044b\u0435 \u0440\u0430\u0437 \u0432 \u043c\u0435\u0441\u044f\u0446. \u0412\u043c\u0435\u0441\u0442\u043e MinIO \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043b\u044e\u0431\u043e\u0435 \u0434\u0440\u0443\u0433\u043e\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435, \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u044b\u0445 restic&#8217;\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c <a href=\"https:\/\/restic.readthedocs.io\/en\/stable\/030_preparing_a_new_repo.html\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<h3>\u041f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u0441\u0441\u044b\u043b\u043a\u0438<\/h3>\n<p><a href=\"https:\/\/restic.readthedocs.io\/en\/stable\/index.html\" rel=\"noopener noreferrer nofollow\">Restic Documentation<\/a><br \/><a href=\"https:\/\/min.io\/docs\/minio\/container\/index.html\" rel=\"noopener noreferrer nofollow\">MinIO docker install documentation<\/a><br \/><a href=\"https:\/\/www.freedesktop.org\/software\/systemd\/man\/systemd.service.html\" rel=\"noopener noreferrer nofollow\">systemd service<\/a><br \/><a href=\"https:\/\/www.freedesktop.org\/software\/systemd\/man\/systemd.timer.html\" rel=\"noopener noreferrer nofollow\">systemd timer<\/a><\/p>\n<\/div>\n<\/div>\n<p> <!----> <!----><\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/739698\/\"> https:\/\/habr.com\/ru\/articles\/739698\/<\/a><br \/><\/br><\/br><\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-348365","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/348365","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=348365"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/348365\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=348365"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=348365"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=348365"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}