|
Prev: How to get log file for rsync operation? Does rsync also deleteremote files?
Next: Is there a way to simulate/preview (but not really do) rsync ?
From: lihao0129 on 5 May 2008 00:00 On May 4, 2:33 am, go...(a)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
From: Moody on 5 May 2008 07:56 On May 4, 12:33 pm, go...(a)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 Possibly: rsync -auvz -e ssh server:/path/source server:/destination/path >> your custom-Logs file other wise U may use sometime like below: rsync -auvz --log-format=FORMAT -e ssh server:/path/source server:/ destination/path where you may specify the log-format in your rsyncd.conf if you are running a rsyncd ( daemon ) ( I never tried this, as I've been using STDOUT option ^ Above ^ for logging the statistics of file transfers... Hope this helps.. Regards, > > How can I get such a log file otherwise? > > BTW: Does rsync delete remote files (from previous rsync operations) if they are not existing > any more on the source system ? > > Goran
From: Todd H. on 5 May 2008 08:50 goran(a)lycos.com (Goran Ivanic) writes: > 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? First, I'm not sure you cross posted to enough newsgroups. You can redirect stderr and stdout to a logfile. rsync blah blah 2>&1 >> mylogfile.txt > BTW: Does rsync delete remote files (from previous rsync operations) if they are not existing > any more on the source system ? It can, if you specify the --delete option. See man rsync for more. -- Todd H. http://www.toddh.net/
From: Scott McMillan on 5 May 2008 10:03 On 04 May 2008 07:33:43 GMT, goran(a)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? With simple redirection: rsync (your options) >>yourlogfile 2>&1 > >BTW: Does rsync delete remote files (from previous rsync operations) if they are not existing >any more on the source system ? It can. See the --delete option(s) in the man page. Scott McMillan
From: Guillaume Dargaud on 5 May 2008 11:46
> How can I get such a log file otherwise? rsync ... >> logfile is good enough for me. Or: --log-file=FILE log what we're doing to the specified FILE --log-file-format=FMT log updates using the specified FMT > BTW: Does rsync delete remote files (from previous rsync operations) if > they are not existing > any more on the source system ? --delete delete extraneous files from dest dirs -- Guillaume Dargaud http://www.gdargaud.net/ |