Added backup.bash

Added backup.bash from my OpenWrt scripts.
This commit is contained in:
kake26 2021-09-25 23:56:05 +02:00
parent ed880365cb
commit 1d6056b61d

21
backup.bash Normal file
View file

@ -0,0 +1,21 @@
#!/bin/bash
# Another OpenWrt bash script
# Run backups via restic
bkpwd="yourbackuppasswordhere" # We are gonna need that
export RESTIC_PASSWORD="$bkpwd"
# resticbasecmd = "restic -r sftp:restic@192.168.1.113:/home/restic backup" # root ssh key must be setup to access the remote target
# OpenWrt uses dropbear so use dropbear's key gen
# Two dirs I want to keep backed up
restic -r sftp:restic@192.168.1.113:/home/restic backup /etc
restic -r sftp:restic@192.168.1.113:/home/restic backup /opt/scripts
restic -r sftp:restic@192.168.1.113:/home/restic backup /root
vnstat -i eth1.2 --exportdb > /tmp/vnstat.db
restic -r sftp:restic@192.168.1.113:/home/restic backup /tmp/vnstat.db
rm /tmp/vnstat.db