Added backup.bash
Added backup.bash from my OpenWrt scripts.
This commit is contained in:
parent
ed880365cb
commit
1d6056b61d
1 changed files with 21 additions and 0 deletions
21
backup.bash
Normal file
21
backup.bash
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue