Rsync (cwrsync) log file

Jeff Boyce jboyce at meridianenv.com
Mon Apr 27 17:02:01 GMT 2009


Greetings -

There is probably a simple answer to this, but I can't seem to figure it 
out.  I would like to have a clean log file of each rsync operation; in 
other words I don't want to have rsync append to the existing log file, but 
instead create a new one each time after deleting the old one.

My situation is this; I run rsync from a shell script on my Linux server 
which backs up our working data directories on the server.  The rsync 
command is copying the files to my Vista desktop box that is running 
cwRsync.  The purpose of this is to have an emergency backup of our working 
data directories in case of a hardware failure on our server, which could be 
used to keep staff working during the period when the server hardware is 
being replaced.  My script is run from cron nightly and it is working fine. 
The problem is that my log file is growing each day and I would like it to 
replace the existing log rather than append to it.  I am having the logs 
written to the Vista box as defined in my cwRsync configuration file on the 
Vista box.  Since the file is on the Vista machine, I can not just add a 
line in my (Linux) script to delete the existing log file before running the 
rsync command.  What would be a simple, or appropriate, way to do this?  I 
would like to have the log file remain on the Vista box.  Thanks.

Jeff Boyce
www.meridianenv.com



More information about the rsync mailing list