From 31b56fd211d34cca60e92b942843ce2861daf0a4 Mon Sep 17 00:00:00 2001
From: Andrea Dell'Amico <adellam@isti.cnr.it>
Date: Mon, 28 Nov 2016 18:40:06 +0100
Subject: [PATCH] library/roles/postgresql/files/postgresql-backup.cron: Log
 the start and end backup date.

---
 postgresql/files/postgresql-backup.cron | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/postgresql/files/postgresql-backup.cron b/postgresql/files/postgresql-backup.cron
index 87339f19..bd7ed0d4 100755
--- a/postgresql/files/postgresql-backup.cron
+++ b/postgresql/files/postgresql-backup.cron
@@ -40,9 +40,11 @@ if [ $PG_BACKUP_ENABLED == 'True' ] ; then
         if [  ! -d $LOG_DIR  ] ; then
             mkdir -p $LOG_DIR
         fi
-        echo "Starting the backup procedure" > $LOG_FILE
+        DATE_START=$( date )
+        echo "$DATE_START: Starting the backup procedure" > $LOG_FILE
         $PG_BCK_BIN >> $LOG_FILE 2>&1
-        echo "Backup procedure finished" >> $LOG_FILE
+        DATE_END=$( date )
+        echo "$DATE_END: Backup procedure finished" >> $LOG_FILE
     fi
 else
     echo "Postgresql backups administratively disabled" > $LOG_FILE