LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   help me on rsync logging (https://www.linuxquestions.org/questions/linux-newbie-8/help-me-on-rsync-logging-789837/)

nroyb2771 02-17-2010 09:04 PM

help me on rsync logging
 
Folks,

I have a problem on logging my rsync activities. I want that the log output filename includes the date and time of the rsync activity. Every time the rsync backup, the logfilename must have date and time.

My problem is, I dont know how to do it.

Can somebody please help me on this, I am using SUSE linux as my OS


thanks

Roy

neonsignal 02-17-2010 09:19 PM

The log file already contains date information on the files, but if you want the date/time as part of the filename, you can do something like:
Code:

rsync -a src dst --log-file="rsync.log.$(date +%Y%m%d%H%m%S)"
The $() expression will run the date command (with format YYYYYYMMDDhhmmss) to include as part of the filename.


All times are GMT -5. The time now is 06:45 AM.