From 1d6056b61de027ccbf72634378f494dee8ec4530 Mon Sep 17 00:00:00 2001 From: kake26 Date: Sat, 25 Sep 2021 23:56:05 +0200 Subject: [PATCH] Added backup.bash Added backup.bash from my OpenWrt scripts. --- backup.bash | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 backup.bash diff --git a/backup.bash b/backup.bash new file mode 100644 index 0000000..854b4a7 --- /dev/null +++ b/backup.bash @@ -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 \ No newline at end of file