:!: This script will generate a similar backup archive file to the one we can download using luci web interface. So, you can use it for restoration as well.

:!: The only purpose of using this script is if you don't want specific files to be included in your backup archive file.

  • Create two directories mkdir /root/backup; mkdir /root/scripts.
  • Get all these three files to /root/scripts/.
  • Make the script executable chmod +x /root/scripts/backup.sh.
  • Run the script /root/scripts/backup.sh.
  • Backup file will be available at /root/backup/ along with a sha256 checksum file.
This file will be generated by script automatically using "sysupgrade --list-backup" command.
backfile=backup-$(uci get system.@system[0].hostname)
# tar backup with gzip and checksum generation
sysupgrade --list-backup > $backinclude
tar c -v -T $backinclude -X $backexclude -f - | gzip > $backdir/$backfile.tar.gz
echo "$(sha256sum $backdir/$backfile.tar.gz | cut -d ' ' -f1)  $backfile.tar.gz" > $backdir/$backfile.tar.gz.sha256sum
This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies
  • Last modified: 2020/10/15 03:14
  • by vvkjndl