Add nextcloud, backup, and ssh setup

This commit is contained in:
Adrian 2020-02-13 23:01:34 +01:00
commit 3200fc17e9
17 changed files with 200 additions and 0 deletions

20
restic/README.md Normal file
View file

@ -0,0 +1,20 @@
# Restic backups
Download binary:
https://github.com/restic/restic/releases/latest
```sh
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
cat /dev/urandom | base64 | head -c 64 | sudo tee /root/backup-key
sudo chmod 600 /root/backup-key
sudo /root/restic-cmd init
sudo crontab crontab
```

2
restic/crontab Normal file
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