Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision Next revisionBoth sides next revision | ||
| user:vvkjndl:openwrt-backup-with-exclusions [2020/10/13 14:08] – created vvkjndl | user:vvkjndl:openwrt-backup-with-exclusions [2020/10/13 14:18] – vvkjndl | ||
|---|---|---|---|
| Line 4: | Line 4: | ||
| :!: The only purpose of using this script is if you don't want specific files to be included in your backup archive file. | :!: 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 '' | ||
| + | * Get all these three files to ''/ | ||
| + | * Make the script executable '' | ||
| + | * Run the script ''/ | ||
| + | * Backup file will be available at / | ||
| <file txt backup-files-include> | <file txt backup-files-include> | ||
| - | This file will be generated by script automatically using '' | + | This file will be generated by script automatically using "sysupgrade --list-backup" command. |
| </ | </ | ||
| + | <file txt backup-files-exclude> | ||
| + | |||
| + | .keep* | ||
| + | .placeholder* | ||
| + | etc/ | ||
| + | |||
| + | </ | ||
| + | |||
| + | <file bash backup.sh> | ||
| + | |||
| + | #!/bin/sh | ||
| + | |||
| + | backdir=/ | ||
| + | backfile=backup-$(uci get system.@system[0].hostname) | ||
| + | backinclude=/ | ||
| + | backexclude=/ | ||
| + | |||
| + | # tar backup with gzip and checksum generation | ||
| + | sysupgrade --list-backup > $backinclude | ||
| + | tar c -v -T $backinclude -X $backexclude -f - | gzip > $backdir/ | ||
| + | echo " | ||
| + | |||
| + | </ | ||