toniblyx / alfresco-backup-and-recovery-tool

Alfresco BART is a tool written in shell script on top of Duplicity to do Alfresco backups and restore from a local file system, FTP, SCP or Amazon S3.
Apache License 2.0
96 stars 48 forks source link

Log lines written always with the same time #31

Open douglascrp opened 7 years ago

douglascrp commented 7 years ago

I have noticed that the log file has all the lines with the same moment, like 2017-06-14-22:00:01

My backup is scheduled using cron, once a day, always on 10 PM, and all the lines keep repeating the moment it started. This backup can take more than one hour, based on the statistics output for the files backup, the latest step:

--------------[ Backup Statistics ]-------------- StartTime 1497491193.45 (Wed Jun 14 22:46:33 2017) EndTime 1497491202.35 (Wed Jun 14 22:46:42 2017)

toniblyx commented 7 years ago

oops! That's seem to be the way I set variables. I'm not really convinced with the way it handles logs. It should be a better way.

Probably adding something like this:

#!/bin/bash -x
exec > /var/log/alfresco-bart.log 2>&1
douglascrp commented 6 years ago

I have just found the script bellow, where the author uses a different syntax I would like to try, so this is why I am reopening this issue.

http://www.contcentric.com/alfresco-backup/

FORMAT="%m-%d-%Y-%H-%M-%S"
echo [$(date +${FORMAT})]"Performing Database Backup"
echo [$(date +${FORMAT})]"Backup Completed"