Created
July 4, 2021 04:38
-
-
Save fffx/5e31f0147354af4484ffd72e4d6e92bc to your computer and use it in GitHub Desktop.
openwrt auto backup 自动备份
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
## usage | |
# chmod +x ./backup.sh | |
# add it to your crontab | |
set -u | |
filepath=/tmp/${HOSTNAME}-$(date +%F)-backup.tar.gz | |
umask go= | |
/sbin/sysupgrade -b $filepath | |
scp $filepath ubuntu@my-server:/mnt/sda1/openwrt_backups | |
rm $filepath | |
echo "Done :)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment