dup: added option --force to cleanup and remove-older-than commands, else they actual...
[matthijs/upstream/backupninja.git] / handlers / pgsql.in
index 23e2c2b42f0553864846b1fba38c91d5d4469e1f..f334bf2fffedbee12148b2a29e55c75f6b62d189 100644 (file)
@@ -21,10 +21,7 @@ if [ $vservers_are_available = yes ]; then
          fatal "The vserver given in vsname ($vsname) does not exist."
       fi
       # is it running ?
-      $VSERVERINFO -q $vsname RUNNING
-      if [ $? -ne 0 ]; then
-         fatal "The vserver $vsname is not running."
-      fi
+      vservers_running $vsname || fatal "The vserver $vsname is not running."
       # everything ok
       info "Using vserver '$vsname'."
       usevserver=yes
@@ -57,7 +54,7 @@ fi
 # create backup dir, the vroot variable will be empty if no vsname was specified
 # and will proceed to operate on the host
 [ -d $vroot$backupdir ] || (debug "mkdir -p $vroot$backupdir"; mkdir -p $vroot$backupdir)
-[ -d $vroot$backupdir ] || fatal "Backup directory '$vroot$backupdir'"
+[ -d $vroot$backupdir ] || fatal "Backup directory '$vroot$backupdir' does not exist, and could not be created."
 
 # give backup dir the good uid and permissions
 # (in respect to the vserver, if $usevserver = yes)