X-Git-Url: https://git.llucax.com/software/bacap.git/blobdiff_plain/39a46f88097147eafc80c9c9cc8e6a182c3e6a7f..f6851c8e5b1bbbb35527e7eb5526bc868c30414b:/bacap diff --git a/bacap b/bacap index dd83d2e..062902a 100755 --- a/bacap +++ b/bacap @@ -100,9 +100,11 @@ do [ "$host" != "$LOCALHOST" ] && src=`awk "{print \"$host:\"\\$1}" "$host_path/paths"` exclude="$host_path/excludes" + include="$host_path/includes" current_link="$host_backup_path/current" current_dir="$host_backup_path/`readlink \"$current_link\"`" exclude_flags= + include_flags= plog "-----------------------------------------------------------------" plog "Backup for host $host" plog "-----------------------------------------------------------------" @@ -117,12 +119,14 @@ do perror "$host is down, skipping..." && continue [ -r "$exclude" ] && - exclude_flags=" --exclude-from=$exclude --delete-excluded" + extra_flags="--exclude-from=$exclude --delete-excluded" + [ -r "$include" ] && + extra_flags="$extra_flags --include-from=$include" plog "Rotating backup..." $run cp -al $V "$current_dir" "$dst" || ret=$(($ret+1)) plog "Running rsync..." - $run rsync $RSYNC_FLAGS $exclude_flags $src "$dst/" || + $run rsync $RSYNC_FLAGS $extra_flags $src "$dst/" || ret=$(($ret+1)) plog "Moving current..." $run rm $V "$current_link" ||