Compare commits
2 Commits
65dda1f790
...
c9bb1f1029
Author | SHA1 | Date |
---|---|---|
Adrian | c9bb1f1029 | |
Adrian | 547ee07a6b |
|
@ -27,7 +27,8 @@ sudo -u cloud unzip -d /data/cloud ~/latest.zip
|
||||||
DOMAIN=example.com
|
DOMAIN=example.com
|
||||||
|
|
||||||
sudo cp nginx.conf /etc/nginx/sites-available/nextcloud
|
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 sed -i '$ r redis.conf' /etc/redis/redis.conf
|
||||||
|
|
||||||
sudo -u cloud cp local.config.php /data/cloud/nextcloud/config
|
sudo -u cloud cp local.config.php /data/cloud/nextcloud/config
|
||||||
|
|
|
@ -9,12 +9,20 @@ REPO=sftp:backup-user@example.com:repo
|
||||||
bunzip2 restic*.bz2
|
bunzip2 restic*.bz2
|
||||||
sudo cp restic* /usr/local/bin/restic
|
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 cp restic-* /usr/local/bin
|
||||||
sudo chmod +x /root/restic-cmd
|
sudo sed -i s/REPO/$REPO/ /usr/local/bin/restic-repo
|
||||||
|
|
||||||
cat /dev/urandom | base64 | head -c 64 | sudo tee /root/backup-key
|
cat /dev/urandom | head -c 48 | base64 | sudo tee /etc/restic-key
|
||||||
sudo chmod 600 /root/backup-key
|
sudo chmod 600 /etc/restic-key
|
||||||
|
|
||||||
sudo /root/restic-cmd init
|
sudo restic-repo init
|
||||||
sudo crontab crontab
|
```
|
||||||
|
|
||||||
|
## `sudo crontab -e`
|
||||||
|
|
||||||
|
```
|
||||||
|
PATH=/usr/local/bin:/usr/bin:/bin
|
||||||
|
|
||||||
|
48 * * * * restic-backup
|
||||||
|
18 2 * * * restic-forget
|
||||||
```
|
```
|
||||||
|
|
|
@ -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
|
|
|
@ -0,0 +1 @@
|
||||||
|
restic-repo backup -q --exclude-if-present .nobackup /data
|
|
@ -0,0 +1 @@
|
||||||
|
restic-repo forget -q --keep-tag keep -H 48 -d 7 -m 12 -y 100
|
|
@ -0,0 +1 @@
|
||||||
|
nice restic -r REPO -p /etc/restic-key "$@"
|
Loading…
Reference in New Issue