mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-26 10:52:57 +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:
@@ -1204,7 +1204,9 @@ char* hw_find_backup_file(const char* output, const char* search_path) {
|
||||
int hw_restore_backup(const char* output, const char* backup_path, const char* destination) {
|
||||
char command[STRING_SIZE];
|
||||
|
||||
snprintf(command, sizeof(command), "/bin/tar xzpf %s -C %s", backup_path, destination);
|
||||
snprintf(command, sizeof(command), "/bin/tar xzpf %s -C %s "
|
||||
"--exclude-from=%s/var/ipfire/backup/exclude --exclude-from=%s/var/ipfire/backup/exclude.user",
|
||||
backup_path, destination, destination, destination);
|
||||
int rc = mysystem(output, command);
|
||||
|
||||
if (rc)
|
||||
|
||||
Reference in New Issue
Block a user