]> oss.titaniummirror.com Git - ovzbpc.git/blobdiff - bpcdump
bpcdump: ouput end date with more description
[ovzbpc.git] / bpcdump
diff --git a/bpcdump b/bpcdump
index 90ecd0291c7dd2de53f3544e5b37edadae3172da..0563e13c99035693d33867f7c53511394ed8a2d3 100755 (executable)
--- a/bpcdump
+++ b/bpcdump
@@ -1,6 +1,8 @@
 #!/bin/bash
 #
 # bpcdump
+# Version: __appVersion__
+#
 # Copyright (C) 2008-2012 by Titanium Mirror, Inc.
 # Author: R. Steve McKown <smckown@titaniummirror.com>
 #
@@ -26,12 +28,20 @@ CONF_DIR=/etc/vz/conf
 
 info()
 {
-    echo "$*" | tee -a "$INFO"
+    if [ -n "$INFO" ]; then
+       echo "$*" | tee -a "$INFO"
+    else
+       echo "$*"
+    fi
 }
 
 error()
 {
-    echo "$*" | tee -a "$INFO" >&2
+    if [ -n "$INFO" ]; then
+       echo "$*" | tee -a "$INFO" >&2
+    else
+       echo "$*"
+    fi
 }
 
 restartve()
@@ -60,12 +70,12 @@ cleanup()
     [ -z "$msg" ] && msg=undef
     restartve
     if [ "$ret" = "0" ]; then
-       info "$(date)"
+       info "Backup completed on $(date)"
        info "cleanup message: $msg"
        info "exit $ret"
        touch "$EXTVEIDFS/good"
     else
-       error "$(date)"
+       error "Backup TERMINATED on $(date)"
        error "cleanup message: $msg"
        error "exit $ret"
        touch "$EXTVEIDFS/bad"