Compare commits

..

No commits in common. "c9bb1f1029ba499659222fc608527e8d01faf3d4" and "65dda1f790c03517b7ab95c67f577b9759951e1d" have entirely different histories.

6 changed files with 9 additions and 19 deletions

View File

@ -27,8 +27,7 @@ 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/nextcloud.conf
sudo ln -s /etc/php/nextcloud.conf /etc/php/*/fpm/pool.d
sudo cp fpm.conf /etc/php/*/fpm/pool.d/nextcloud.conf
sudo sed -i '$ r redis.conf' /etc/redis/redis.conf
sudo -u cloud cp local.config.php /data/cloud/nextcloud/config

View File

@ -9,20 +9,12 @@ REPO=sftp:backup-user@example.com:repo
bunzip2 restic*.bz2
sudo cp restic* /usr/local/bin/restic
sudo cp restic-* /usr/local/bin
sudo sed -i s/REPO/$REPO/ /usr/local/bin/restic-repo
echo 'nice /usr/local/bin/restic -r' "$REPO" '-p /root/backup-key "$@"' | sudo tee /root/restic-cmd
sudo chmod +x /root/restic-cmd
cat /dev/urandom | head -c 48 | base64 | sudo tee /etc/restic-key
sudo chmod 600 /etc/restic-key
cat /dev/urandom | base64 | head -c 64 | sudo tee /root/backup-key
sudo chmod 600 /root/backup-key
sudo restic-repo init
```
## `sudo crontab -e`
```
PATH=/usr/local/bin:/usr/bin:/bin
48 * * * * restic-backup
18 2 * * * restic-forget
sudo /root/restic-cmd init
sudo crontab crontab
```

2
restic/crontab 100644
View File

@ -0,0 +1,2 @@
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

View File

@ -1 +0,0 @@
restic-repo backup -q --exclude-if-present .nobackup /data

View File

@ -1 +0,0 @@
restic-repo forget -q --keep-tag keep -H 48 -d 7 -m 12 -y 100

View File

@ -1 +0,0 @@
nice restic -r REPO -p /etc/restic-key "$@"