Koozali.org: home of the SME Server

Bakckup Time lines

Offline smnirosh

  • ****
  • 329
  • +0/-0
  • Learning never ends
Bakckup Time lines
« on: April 22, 2016, 10:23:34 AM »
Hi friends, I am running backup using rsync command. I have set the incremental backup process at 8.00pm everyday. Plus I receive an email when backup time starts. But I want to know the terminated time of the backup from log. Only the start time will be appear but no terminated time in log file. is there any procedure to verify that time?

Offline Stefano

  • *
  • 10,839
  • +2/-0
Re: Bakckup Time lines
« Reply #1 on: April 22, 2016, 10:44:12 AM »
first of all tell us how you're doing backup, since you're using a custom script

moving to contribs section

Offline smnirosh

  • ****
  • 329
  • +0/-0
  • Learning never ends
Re: Bakckup Time lines
« Reply #2 on: April 22, 2016, 10:49:44 AM »
rsync -avr --delete --log-file="/var/log/rsync/rsync.log.$(date)" /home /mnt/nas

where "nas" is a nas drive which is mounted to /mnt/nas folder.

Offline Stefano

  • *
  • 10,839
  • +2/-0
Re: Bakckup Time lines
« Reply #3 on: April 22, 2016, 10:54:44 AM »
well.. you'd encapsulate such command into a custom script that sends you an email with wished info

if you search out there (google) for "rsync backup script" you'll find zillions

P.S. making a raw backup of your home dir is not enough to restore your server, expecially if it's a DC

Offline smnirosh

  • ****
  • 329
  • +0/-0
  • Learning never ends
Re: Bakckup Time lines
« Reply #4 on: April 22, 2016, 10:57:06 AM »
I already receives an email. But it doesn't contain the information which i am searching for now

Offline Stefano

  • *
  • 10,839
  • +2/-0
Re: Bakckup Time lines
« Reply #5 on: April 22, 2016, 11:02:03 AM »
please, re read my suggestion

you'd embed rsync command into a script

something like (pseudo code)

Code: [Select]
NOW=`date`
echo "starting backup: $NOW"
rsync .......
NOW=`date`
echo "finish backup: $NOW"


Offline smnirosh

  • ****
  • 329
  • +0/-0
  • Learning never ends
Re: Bakckup Time lines
« Reply #6 on: April 22, 2016, 01:41:46 PM »
I tried follwoing and got good result:

NOW="$(date)"
echo "time star: $NOW"
rsync...
NOW="$(date)"
echo "time end: $NOW"