From 547ee07a6be22d24f5afcb2f3cf112270b380881 Mon Sep 17 00:00:00 2001 From: Adrian Date: Sun, 14 Jun 2020 11:11:56 +0200 Subject: [PATCH 1/2] Move fpm pool files out of version directory --- nextcloud/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nextcloud/README.md b/nextcloud/README.md index 69888f3..9a94f75 100644 --- a/nextcloud/README.md +++ b/nextcloud/README.md @@ -27,7 +27,8 @@ sudo -u cloud unzip -d /data/cloud ~/latest.zip DOMAIN=example.com sudo cp nginx.conf /etc/nginx/sites-available/nextcloud -sudo cp fpm.conf /etc/php/*/fpm/pool.d/nextcloud.conf +sudo cp fpm.conf /etc/php/nextcloud.conf +sudo ln -s /etc/php/nextcloud.conf /etc/php/*/fpm/pool.d sudo sed -i '$ r redis.conf' /etc/redis/redis.conf sudo -u cloud cp local.config.php /data/cloud/nextcloud/config From c9bb1f1029ba499659222fc608527e8d01faf3d4 Mon Sep 17 00:00:00 2001 From: Adrian Date: Fri, 27 Nov 2020 00:06:14 +0100 Subject: [PATCH 2/2] Use seperate commands for restic backup and forget --- restic/README.md | 20 ++++++++++++++------ restic/crontab | 2 -- restic/restic-backup | 1 + restic/restic-forget | 1 + restic/restic-repo | 1 + 5 files changed, 17 insertions(+), 8 deletions(-) delete mode 100644 restic/crontab create mode 100755 restic/restic-backup create mode 100755 restic/restic-forget create mode 100755 restic/restic-repo diff --git a/restic/README.md b/restic/README.md index 2f94664..c8a5718 100644 --- a/restic/README.md +++ b/restic/README.md @@ -9,12 +9,20 @@ REPO=sftp:backup-user@example.com:repo bunzip2 restic*.bz2 sudo cp restic* /usr/local/bin/restic -echo 'nice /usr/local/bin/restic -r' "$REPO" '-p /root/backup-key "$@"' | sudo tee /root/restic-cmd -sudo chmod +x /root/restic-cmd +sudo cp restic-* /usr/local/bin +sudo sed -i s/REPO/$REPO/ /usr/local/bin/restic-repo -cat /dev/urandom | base64 | head -c 64 | sudo tee /root/backup-key -sudo chmod 600 /root/backup-key +cat /dev/urandom | head -c 48 | base64 | sudo tee /etc/restic-key +sudo chmod 600 /etc/restic-key -sudo /root/restic-cmd init -sudo crontab crontab +sudo restic-repo init +``` + +## `sudo crontab -e` + +``` +PATH=/usr/local/bin:/usr/bin:/bin + +48 * * * * restic-backup +18 2 * * * restic-forget ``` diff --git a/restic/crontab b/restic/crontab deleted file mode 100644 index 5d2bebc..0000000 --- a/restic/crontab +++ /dev/null @@ -1,2 +0,0 @@ -48 * * * * /root/restic-cmd backup -q --exclude-if-present .nobackup /data -18 3 * * * /root/restic-cmd forget -q --keep-tag keep -H 24 -d 7 -m 12 -y 100 diff --git a/restic/restic-backup b/restic/restic-backup new file mode 100755 index 0000000..06288ba --- /dev/null +++ b/restic/restic-backup @@ -0,0 +1 @@ +restic-repo backup -q --exclude-if-present .nobackup /data diff --git a/restic/restic-forget b/restic/restic-forget new file mode 100755 index 0000000..a936c5c --- /dev/null +++ b/restic/restic-forget @@ -0,0 +1 @@ +restic-repo forget -q --keep-tag keep -H 48 -d 7 -m 12 -y 100 diff --git a/restic/restic-repo b/restic/restic-repo new file mode 100755 index 0000000..13ab325 --- /dev/null +++ b/restic/restic-repo @@ -0,0 +1 @@ +nice restic -r REPO -p /etc/restic-key "$@"