mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-28 11:43:25 +02:00
backup: Don't restore excluded files
Sometimes, we restore a backup that has been created earlier before exclude files have been changed. To avoid overwriting those files, we will consider the exlude list upon restore. Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
@@ -72,7 +72,9 @@ restore_backup() {
|
||||
local filename="${1}"
|
||||
|
||||
# Extract backup
|
||||
if ! tar xvzpf "${filename}" -C /; then
|
||||
if ! tar xvzpf "${filename}" -C / \
|
||||
--exclude-from="/var/ipfire/backup/exclude" \
|
||||
--exclude-from="/var/ipfire/backup/exclude.user"; then
|
||||
echo "Could not extract backup" >&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user