21 lines
No EOL
706 B
Bash
21 lines
No EOL
706 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
|
|
|
|
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 |