{"id":317226,"date":"2021-01-31T03:00:19","date_gmt":"2021-01-31T03:00:19","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=317226"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=317226","title":{"rendered":"\u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c Restic \u0441 systemd \u043d\u0430 Linux"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\">\n<p><a href=\"https:\/\/restic.net\" rel=\"nofollow noopener noreferrer\">Restic<\/a> \u2014 \u0445\u043e\u0440\u043e\u0448\u043e \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0430\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0434\u043b\u044f \u0440\u0435\u0437\u0435\u0440\u0432\u043d\u043e\u0433\u043e \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u041e\u043d\u0430 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u0430, \u0447\u0442\u043e\u0431\u044b \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u0442\u044c\u0441\u044f \u043d\u0430 \u043b\u044e\u0431\u0443\u044e \u041e\u0421, \u0438, \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441 \u043d\u0435\u0439 \u043d\u0435 \u043f\u0440\u0438\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043d\u0430 \u0441\u0440\u0435\u0434\u043d\u0435\u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 Linux-\u0441\u0438\u0441\u0442\u0435\u043c\u0435. \u0418\u0441\u043f\u0440\u0430\u0432\u0438\u043c \u044d\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u043c \u043f\u043e\u0441\u0442\u043e\u043c.<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u0441\u0442\u0430\u0432\u0438\u043c \u0437\u0430\u0434\u0430\u0447\u0443 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<p>  <\/p>\n<ol>\n<li>\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0431\u044d\u043a\u0430\u043f \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0435\u0436\u0435\u0434\u043d\u0435\u0432\u043d\u043e.<\/li>\n<li>\u0411\u044d\u043a\u0430\u043f \u0445\u0440\u0430\u043d\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u0430\u0436\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u0438 \u0434\u0430\u043d\u043d\u044b\u0435.<\/li>\n<li>\u0411\u044d\u043a\u0430\u043f \u0442\u0430\u043a\u0436\u0435 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0431\u0430\u0437 PostgreSQL, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c <code>psql -f<\/code>.<\/li>\n<\/ol>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">TL;DR \u043f\u043e\u0441\u0442\u0430<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<p>\u041f\u0438\u0448\u0435\u043c \u0434\u0432\u0430 \u044e\u043d\u0438\u0442\u0430 \/ \u0442\u0430\u0439\u043c\u0435\u0440\u0430 \u0434\u043b\u044f systemd, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c restic \u043f\u043e\u0434 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c \u0441 <code>CAP_DAC_READ_SEARCH<\/code>, \u0434\u043b\u044f PostgreSQL \u0430\u0440\u0445\u0438\u0432\u0438\u0440\u0443\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 <code>pg_dumpall<\/code>.<\/p>\n<\/div><\/div>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0431\u044d\u043a\u0430\u043f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043d\u0430 \u043c\u0430\u0448\u0438\u043d\u0435 \u0441 Ubuntu Server 20.04 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0430 <a href=\"https:\/\/github.com\/restic\/rest-server\" rel=\"nofollow noopener noreferrer\">rest-server<\/a>, \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0439 \u043d\u0430 <code>192.168.1.200<\/code>. \u0422\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u043e \u0430\u0434\u0430\u043f\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043a \u043b\u044e\u0431\u043e\u043c\u0443 \u043e\u0431\u043b\u0430\u0447\u043d\u043e\u043c\u0443 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0443. \u0422\u0430\u043a\u0436\u0435 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0443\u0436\u0435 \u043f\u0440\u043e\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 <code>restic -r rest:http:\/\/192.168.1.200\/your-repo\/ init<\/code>.<\/p>\n<p>  <\/p>\n<h2 id=\"bekapim-faylydirektorii\">\u0411\u044d\u043a\u0430\u043f\u0438\u043c \u0444\u0430\u0439\u043b\u044b\/\u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438<\/h2>\n<p>  <\/p>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u041f\u041e \u0441 \u043f\u0440\u0430\u0432\u0430\u043c\u0438 \u0441\u0443\u043f\u0435\u0440\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0431\u0435\u0437 \u043e\u0441\u043e\u0431\u043e\u0439 \u043d\u0430\u0434\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u043d\u0435\u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0434\u043b\u044f \u043d\u0430\u0448\u0438\u0445 \u0437\u0430\u0434\u0430\u0447 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f <code>restic<\/code> \u0431\u0435\u0437 \u0433\u0440\u0443\u043f\u043f\u044b \u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u043e\u0431\u043e\u043b\u043e\u0447\u043a\u0438:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\"># useradd -m -N -s \/usr\/sbin\/nologin restic<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0441\u0435\u0440\u0432\u0438\u0441 systemd \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c \u0438 \u0442\u0430\u0439\u043c\u0435\u0440 \u043a \u043d\u0435\u043c\u0443:<\/p>\n<p>  <\/p>\n<p><code>\/etc\/systemd\/system\/restic@.service<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">[Unit] # \u044e\u043d\u0438\u0442 \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c \u043f\u043e\u0441\u043b\u0435 @, \u0442\u043e \u0435\u0441\u0442\u044c \u0432 #   systemctl start restic@your-repo.service # %I \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 &quot;your-repo&quot; Description=Restic backup on %I After=syslog.target After=network-online.target  [Service] Type=oneshot User=restic # \u0447\u0438\u0442\u0430\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0444\u0430\u0439\u043b\u043e\u0432 \u043a \u0431\u044d\u043a\u0430\u043f\u0443 \u0431\u0443\u0434\u0435\u043c \u0438\u0437 \/etc\/restic\/your-repo.files ExecStart=\/usr\/local\/bin\/restic backup --files-from \/etc\/restic\/%I.files # \u0441\u0447\u0438\u0442\u0430\u0435\u043c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0438 \u043f\u0430\u0440\u043e\u043b\u044c \u0438\u0437 \/etc\/restic\/your-repo.env EnvironmentFile=\/etc\/restic\/%I.env # \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c restic \u0441 capability DAC_READ_SEARCH, \u0434\u0430\u044e\u0449\u0435\u0439 \u043f\u0440\u0430\u0432\u043e # \u043e\u0431\u0445\u043e\u0434\u0438\u0442\u044c \u043f\u0440\u0430\u0432\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u0424\u0421 \u0432 Linux, \u044d\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0434\u043b\u044f \u0431\u044d\u043a\u0430\u043f\u0430 # \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0447\u0438\u0442\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 # \u0438\u043b\u0438 \u0441\u0443\u043f\u0435\u0440\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c AmbientCapabilities=CAP_DAC_READ_SEARCH  [Install] WantedBy=multi-user.target<\/code><\/pre>\n<p>  <\/p>\n<p><code>\/etc\/systemd\/system\/restic@.timer<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">[Unit] # \u0442\u0430\u0439\u043c\u0435\u0440, \u0431\u0443\u0434\u0443\u0447\u0438 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u043c \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c \u043f\u043e\u0441\u043b\u0435 @ # (restic@your-repo.timer), \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442 restic@your-repo.service Description=Run Restic at 12:00 AM  [Timer] # \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c restic \u0435\u0436\u0435\u0434\u043d\u0435\u0432\u043d\u043e \u0432 12 \u0447\u0430\u0441\u043e\u0432 \u043d\u043e\u0447\u0438 OnCalendar=*-*-* 12:00:00  [Install] WantedBy=timers.target<\/code><\/pre>\n<p>  <\/p>\n<p>\u0410\u0434\u0440\u0435\u0441 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f \u0438 \u043f\u0430\u0440\u043e\u043b\u044c \u043e\u0442 \u043d\u0435\u0433\u043e \u043f\u043e\u0434\u0430\u044e\u0442\u0441\u044f \u043d\u0430 \u0432\u0445\u043e\u0434 \u0447\u0435\u0440\u0435\u0437 \u0444\u0430\u0439\u043b \u0441 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438 \u0441\u0440\u0435\u0434\u044b \u0432 <code>\/etc\/restic\/your-repo.env<\/code>. systemd \u0447\u0438\u0442\u0430\u0435\u0442 \u0438\u0445 \u043f\u0440\u0438 \u0441\u0442\u0430\u0440\u0442\u0435 \u044e\u043d\u0438\u0442\u0430 \u0441 \u043f\u0440\u0430\u0432\u0430\u043c\u0438 root, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u0441\u043b \u0437\u0430\u0434\u0430\u0442\u044c \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 <code>\/etc\/restic\/<\/code> \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c (\u0442.\u0435. 700 \u0438 \u0432\u043b\u0430\u0434\u0435\u043b\u044c\u0446\u0435\u043c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c <code>root<\/code>):<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">RESTIC_PASSWORD=your_repo_password RESTIC_REPOSITORY=rest:http:\/\/192.168.1.200\/your-repo\/<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u0430\u043c \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0441\u043f\u0438\u0441\u043e\u043a \u0444\u0430\u0439\u043b\u043e\u0432\/\u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0439 \u043a \u0431\u044d\u043a\u0430\u043f\u0443 \u0432 <code>\/etc\/restic\/your-repo.files<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">\/var\/lib\/docker \/etc\/postgresql \/etc\/restic ...<\/code><\/pre>\n<p>  <\/p>\n<h2 id=\"bekap-postgresql\">\u0411\u044d\u043a\u0430\u043f PostgreSQL<\/h2>\n<p>  <\/p>\n<p>Restic \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u0434\u0430\u0447\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u0431\u044d\u043a\u0430\u043f\u0430 \u0447\u0435\u0440\u0435\u0437 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0432\u0445\u043e\u0434, \u0442\u0430\u043a \u0447\u0442\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043a\u043e\u0440\u043c\u0438\u0442\u044c \u0435\u043c\u0443 \u0434\u0430\u043c\u043f, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 <code>pg_dumpall<\/code>. \u0422\u0430\u043a \u043a\u0430\u043a systemd \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0435 \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u043e\u0439 <code>ExecStart<\/code> \u0432\u044b\u0437\u043e\u0432\u043e\u043c <code>execve(3)<\/code>, \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u0438 \u0441\u0436\u0430\u0442\u0438\u044f \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 <code>\/usr\/local\/bin\/pgdump.sh<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">#!\/usr\/bin\/env bash  set -euo pipefail  \/usr\/bin\/sudo -u postgres pg_dumpall --clean \\     | gzip --rsyncable \\     | \/usr\/local\/bin\/restic backup --host $1 --stdin \\         --stdin-filename postgres-$1.sql.gz<\/code><\/pre>\n<p>  <\/p>\n<p>\u0421\u0435\u0440\u0432\u0438\u0441 <code>\/etc\/systemd\/system\/restic-pg@.service<\/code> \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u0435\u043d:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">[Unit] Description=Restic PostgreSQL backup on %I After=syslog.target After=network-online.target After=postgresql.service Requires=postgresql.service  [Service] Type=oneshot User=restic ExecStart=\/usr\/local\/bin\/pgdump.sh %I EnvironmentFile=\/etc\/restic\/%I.env  [Install] WantedBy=multi-user.target<\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u0430\u0439\u043c\u0435\u0440 <code>\/etc\/systemd\/system\/restic-pg@.timer<\/code> \u043d\u0435 \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u0432\u0438\u0434\u0435\u043d\u043d\u043e\u0433\u043e \u0432\u044b\u0448\u0435:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">[Unit] Description=Run Restic on PostgreSQL at 12:00 AM  [Timer] OnCalendar=*-*-* 0:00:00  [Install] WantedBy=timers.target<\/code><\/pre>\n<p>  <\/p>\n<h2 id=\"zavershaem\">\u0417\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u043c<\/h2>\n<p>  <\/p>\n<p>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0442\u0430\u0439\u043c\u0435\u0440\u044b \u0438 \u0432\u043a\u043b\u044e\u0447\u0438\u043c \u0438\u0445 \u0430\u0432\u0442\u043e\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\"># systemctl enable --now restic@your-repo.timer restic-pg@your-repo.timer<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c, \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043b\u0438 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\"># systemctl start restic@your-repo.service # systemctl start restic-pg@your-repo.service<\/code><\/pre>\n<p>  <\/p>\n<p>\u0414\u0430\u043d\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u044e\u043d\u0438\u0442\u043e\u0432 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0431\u044d\u043a\u0430\u043f\u0438\u0442\u044c\u0441\u044f \u0432 \u043d\u0435\u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0435\u0432, \u043d\u0443\u0436\u043d\u043e \u043b\u0438\u0448\u044c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 <code>\/etc\/restic\/repo-name.{env,files}<\/code>.<\/p>\n<p>  <\/p>\n<h2 id=\"ssylki\">\u0421\u0441\u044b\u043b\u043a\u0438<\/h2>\n<p>  <\/p>\n<ul>\n<li><a href=\"https:\/\/forum.restic.net\/t\/recipe-to-snapshot-postgres-container\/1707\" rel=\"nofollow noopener noreferrer\">\u0420\u0435\u0446\u0435\u043f\u0442 \u0431\u044d\u043a\u0430\u043f\u0430 PostgreSQL \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435<\/a>, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0432\u044b\u0440\u043e\u0441 \u0441\u043a\u0440\u0438\u043f\u0442 \u0432 \u043f\u043e\u0441\u0442\u0435.<\/li>\n<li>\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f systemd: <a href=\"https:\/\/www.freedesktop.org\/software\/systemd\/man\/systemd.service.html\" rel=\"nofollow noopener noreferrer\">systemd.service<\/a>, <a href=\"https:\/\/www.freedesktop.org\/software\/systemd\/man\/systemd.timer.html\" rel=\"nofollow noopener noreferrer\">systemd.timer<\/a>.<\/li>\n<li>\u042d\u0442\u043e\u0442 \u043f\u043e\u0441\u0442 \u0432 \u043c\u043e\u0435\u043c \u0431\u043b\u043e\u0433\u0435 <a href=\"https:\/\/tdem.in\/post\/restic-with-systemd\/\" rel=\"nofollow noopener noreferrer\">\u043d\u0430 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u043e\u043c \u044f\u0437\u044b\u043a\u0435<\/a>.<\/li>\n<\/ul>\n<\/div>\n<p> \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\/post\/540096\/\"> https:\/\/habr.com\/ru\/post\/540096\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\">\n<p><a href=\"https:\/\/restic.net\" rel=\"nofollow noopener noreferrer\">Restic<\/a> \u2014 \u0445\u043e\u0440\u043e\u0448\u043e \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0430\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0434\u043b\u044f \u0440\u0435\u0437\u0435\u0440\u0432\u043d\u043e\u0433\u043e \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u041e\u043d\u0430 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u0430, \u0447\u0442\u043e\u0431\u044b \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u0442\u044c\u0441\u044f \u043d\u0430 \u043b\u044e\u0431\u0443\u044e \u041e\u0421, \u0438, \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441 \u043d\u0435\u0439 \u043d\u0435 \u043f\u0440\u0438\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043d\u0430 \u0441\u0440\u0435\u0434\u043d\u0435\u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 Linux-\u0441\u0438\u0441\u0442\u0435\u043c\u0435. \u0418\u0441\u043f\u0440\u0430\u0432\u0438\u043c \u044d\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u043c \u043f\u043e\u0441\u0442\u043e\u043c.<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u0441\u0442\u0430\u0432\u0438\u043c \u0437\u0430\u0434\u0430\u0447\u0443 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<p>  <\/p>\n<ol>\n<li>\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0431\u044d\u043a\u0430\u043f \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0435\u0436\u0435\u0434\u043d\u0435\u0432\u043d\u043e.<\/li>\n<li>\u0411\u044d\u043a\u0430\u043f \u0445\u0440\u0430\u043d\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u0430\u0436\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u0438 \u0434\u0430\u043d\u043d\u044b\u0435.<\/li>\n<li>\u0411\u044d\u043a\u0430\u043f \u0442\u0430\u043a\u0436\u0435 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0431\u0430\u0437 PostgreSQL, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c <code>psql -f<\/code>.<\/li>\n<\/ol>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">TL;DR \u043f\u043e\u0441\u0442\u0430<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<p>\u041f\u0438\u0448\u0435\u043c \u0434\u0432\u0430 \u044e\u043d\u0438\u0442\u0430 \/ \u0442\u0430\u0439\u043c\u0435\u0440\u0430 \u0434\u043b\u044f systemd, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c restic \u043f\u043e\u0434 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c \u0441 <code>CAP_DAC_READ_SEARCH<\/code>, \u0434\u043b\u044f PostgreSQL \u0430\u0440\u0445\u0438\u0432\u0438\u0440\u0443\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 <code>pg_dumpall<\/code>.<\/p>\n<\/div><\/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-317226","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/317226","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=317226"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/317226\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=317226"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=317226"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=317226"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}