Newer
Older

micah
committed
# sane permission on backup
mkdir -p $backupdir/$VROOTDIR
chmod 000 $backupdir/$VROOTDIR
for candidate in $found_vservers; do
candidate="`basename $candidate`"
found_excluded_vserver="0"
for excluded_vserver in $exclude_vserver; do
if [ "$excluded_vserver" == "$candidate" ]; then
found_excluded_vserver="1"
break
fi
done
if [ "$found_excluded_vserver" == "0" ]; then

micah
committed
if [ "$multiconnection" == "yes" ]; then
debug "Starting master ssh connection"
$ssh_cmd -M sleep 1d &
sleep 1
fi
if [ "$multiconnection" == "yes" ]; then
debug "Stopping master ssh connection"
$ssh_cmd pkill sleep
fi
set_lockfile
set_rsync_options
start_mux
stop_services
mount_rw

micah
committed

micah
committed
prepare_storage
set_orig
set_batch_mode
set_filelist
set_dest
info "Syncing $SECTION on $dest_path..."
debug $nice $rsync "${rsync_options[@]}" $filelist_flag $excludes $batch_option $orig $dest_path
$nice $rsync "${rsync_options[@]}" $filelist_flag $excludes $batch_option $orig $dest_path | tee -a $log

micah
committed
if [ "$?" != "0" ]; then
warning "Rsync error when trying to transfer $SECTION"
fi
update_metadata

micah
committed
mount_ro
run_fsck
start_services
unset_lockfile
end_mux
echo "Finnishing backup at `date`" >> $log