# Load default config and override config if correspond
load_config
source "$host_path/bacaprc" 2>/dev/null
host=`basename "$host_path"`
host_backup_path="$BACKUP_PATH/$host"
# Load default config and override config if correspond
load_config
source "$host_path/bacaprc" 2>/dev/null
host=`basename "$host_path"`
host_backup_path="$BACKUP_PATH/$host"
dst="$BACKUP_PATH/$host/$date"
src=`cat "$host_path/paths"`
[ "$host" != "$LOCALHOST" ] &&
src=`awk "{print \"$host:\"\\$1}" "$host_path/paths"`
exclude="$host_path/excludes"
dst="$BACKUP_PATH/$host/$date"
src=`cat "$host_path/paths"`
[ "$host" != "$LOCALHOST" ] &&
src=`awk "{print \"$host:\"\\$1}" "$host_path/paths"`
exclude="$host_path/excludes"
current_link="$host_backup_path/current"
current_dir="$host_backup_path/`readlink \"$current_link\"`"
current_link="$host_backup_path/current"
current_dir="$host_backup_path/`readlink \"$current_link\"`"
plog "-----------------------------------------------------------------"
plog "Backup for host $host"
plog "-----------------------------------------------------------------"
plog "-----------------------------------------------------------------"
plog "Backup for host $host"
plog "-----------------------------------------------------------------"
- exclude_flags=" --exclude-from=$exclude --delete-excluded"
- plog "Rotating backup..."
- $run cp -al $V "$current_dir" "$dst" ||
- ret=$(($ret+1))
+ extra_flags="--exclude-from=$exclude --delete-excluded"
+ [ -r "$include" ] &&
+ extra_flags="$extra_flags --include-from=$include"