Re: How to get log file for rsync operation? Does rsync also deleteremote files?
On May 4, 2:33 am, go...@lycos.com (Goran Ivanic) wrote:
> I am planning to use rsync for a daily backup to a remote backup server.
>
> When I read the rsync manual it does not become clear on how to write a log file for the rsync operation.
>
> I am missing options like:
>
> rsync ..... -logfile=\home\backup\rsync.log -logmode=append ......
>
> Did I miss these options?
>
> I want to write (append !!) to the log file:
>
> - Which files were transferred
> - When the rsync operation took place
> - How much bytes were transferred (total sum) in the rsync operation
>
> How can I get such a log file otherwise?
what *nix box are you using? I have rsync under Ubuntu and RHEL5, and
they use very different ways to handle logfile:
for Ubuntu, I use:
rsync -aqC --delete -i --log-file=/var/log/mytest.log SRC DEST
2>&1 1>/dev/null
(logfile are in append mode automatically. at least for my server)
for RHEL5:
rsync -i --delete -avC SRC DEST 1>>/var/log/mytest.log 2>/dev/null
> BTW: Does rsync delete remote files (from previous rsync operations) if they are not existing
> any more on the source system ?
use --delete option, old files which are not on SRC will be removed
from the DESC.
lihao
|