- `/etc/backups-script.d/clientXY.example.com`: configuration for host 2
+### Global Settings
+
+The following global configuration options exist:
+
+- `setup_exec`: Script to run _before_ creating the lock file etc.
+- `pre_exec`: Pre-execution script, run before all jobs.
+- `post_exec`: Post-execution script, run after all jobs.
+
+In Addition, all job configuration options (see below) that have a "default_XXX"
+variant can be used and define default values for all jobs that don't overwrite
+them individually.
+
+
## Configuration Variables
### system
### Compatibility Variables
-The following configurations variables used by the backup-pull(1) script in job
-definition files are automatically mapped to the new backup-script variables:
+The following job configurations variables used by the outdated backup-pull(1)
+script in job definition files are automatically mapped to the new backup-script
+variables:
* host -> system
* source -> source_root
[ -d "/usr/local/etc/backup-script.d" ] \
&& conf_d="/usr/local/etc/backup-script.d" \
|| conf_d="/etc/backup-script.d"
+setup_exec=""
pre_exec=""
post_exec=""
default_backup_type="rsync"
sys=("${conf_d}/"*)
fi
+if [ -n "$setup_exec" ]; then
+ echo "Executing \"$setup_exec\" ..."
+ sh -c $setup_exec
+ if [ $? -ne 0 ]; then
+ echo "Error: setup command failed!"; echo
+ CleanUp
+ echo "Aborting backup."; echo
+ exit 5
+ fi
+ sleep 2
+ echo
+fi
+
# check and create PID file
if [ -e "$PIDFILE" ]; then
echo "Lockfile \"$PIDFILE\" already exists."