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
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)