- set -o noglob
- for ((i=0; i < ${#rdiff_includes[@]} ; i++)); do
- echo "include = ${rdiff_includes[$i]}" >> $next_filename
- done
- for ((i=0; i < ${#rdiff_excludes[@]} ; i++)); do
- echo exclude = ${rdiff_excludes[$i]} >> $next_filename
- done
- set +o noglob
- cat >> $next_filename <<EOF
+
+ if [ "$host_or_vservers" == host -o "$host_or_vservers" == both ]
+ then
+ set -o noglob
+
+ for ((i=0; i < ${#rdiff_includes[@]} ; i++))
+ do
+ echo "include = ${rdiff_includes[$i]}" >> $next_filename
+ done
+
+ set +o noglob
+ fi
+
+ if [ "$host_or_vservers" == vservers -o "$host_or_vservers" == both ]
+ then
+ cat >> $next_filename <<EOF
+#
+# If vservers = yes in /etc/backupninja.conf then the following variables can
+# be used:
+# vsnames = all | <vserver1> <vserver2> ... (default = all)
+# vsinclude = <path>
+# vsinclude = <path>
+# ...
+# Any path specified in vsinclude is added to the include list for each vserver
+# listed in vsnames (or all if vsnames = all).
+#
+# For example, vsinclude = /home will backup the /home partition in every
+# vserver listed in vsnames. If you have vsnames = "foo bar baz", this
+# vsinclude will add to the include list /vservers/foo/home,
+# /vservers/bar/home and /vservers/baz/home.
+# Vserver paths are derived from $VROOTDIR.
+
+EOF
+
+ set -o noglob
+ echo -e "vsnames = \"$selected_vservers\"\n" >> $next_filename
+ for i in $rdiff_vsincludes; do
+ echo "vsinclude = $i" >> $next_filename
+ done
+ set +o noglob
+ fi
+
+ # excludes
+
+ for ((i=0; i < ${#rdiff_excludes[@]} ; i++))
+ do
+ echo exclude = ${rdiff_excludes[$i]} >> $next_filename
+ done
+ set +o noglob
+ cat >> $next_filename <<EOF
+
+######################################################
+## destination section
+## (where the files are copied to)