Bash-Stash/backup.bash
kake26 3ccf356c11 vnstat fix
Configured vnstat to save DB to external USB.

Per

https://openwrt.org/docs/guide-user/services/network_monitoring/vnstat

This was to solve the persistence issue. Now vnstat db should be backed up normally.
2022-12-26 22:40:13 -06:00

23 lines
No EOL
978 B
Bash

#!/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
/usb/scripts/bin/restic -r sftp:pi@192.168.1.168:/storage/backup/openwrt backup /etc
curl -d "ETC backed up" 192.168.1.168:83/openwrt_backup
/usb/scripts/bin/restic -r sftp:pi@192.168.1.168:/storage/backup/openwrt backup /usb/scripts
curl -d "Scripts backed up" 192.168.1.168:83/openwrt_backup
/usb/scripts/bin/restic -r sftp:pi@192.168.1.168:/storage/backup/openwrt backup /root
curl -d "Root backed up" 192.168.1.168:83/openwrt_backup
/usb/scripts/bin/restic -r sftp:pi@192.168.1.168:/storage/backup/openwrt backup /usb/vnstat/vnstat.db
curl -d "Vnstat backed up" 192.168.1.168:83/openwrt_backup