LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-01-2010, 07:52 AM   #1
Hans Troost
LQ Newbie
 
Registered: May 2005
Location: The Netherlands
Distribution: PCLinuxOS
Posts: 5

Rep: Reputation: 0
rsync: log-file: howto get rid of ".d...p..... send"


I'm just starting with rsync, googled and experienced a lot, but get stuck with
minimizing the log-file: I only want to see the "real" changes: new, updated and
deleted files/directories in the log-file.
The LOG-file always contains a lot of lines like:


2010/08/31 20:19:01 [24573] .d...p..... send home/hans/Desktop
2010/08/31 20:19:05 [24573] .d...p..... send home/hans/Documents/PCPa

I did not change anything, also not the permissions. So these directories are
unchanged!

Question: how to get rid of these lines, while keeping lines like:

2010/08/31 20:19:01 [24573] >f.stp..... send home/hans/2bedited.txt
2010/08/31 20:19:01 [24573] >f+++++++++ send home/hans/Documents/newfile.txt

Want to use rscync for a "manual backup" (now and then) and my situation is:

Source: workstation with PCLinuxOS 2010.
Destination: a NAS (LaCie Ethernet Disk mini) with a share called Backup,
mounted as /mnt/backup:


[hans@localhost mnt]$ ls -l
...
drwxr-xr-x 4 hans hans 0 2010-08-31 20:18 backup/
...
[hans@localhost mnt]$ ls -l backup
total 0
drwxr-xr-x 2 hans hans 0 2010-08-31 19:39 deleted/
drwxr-xr-x 9 hans hans 0 2010-08-31 20:18 hans/
drwxr-xr-x 2 hans hans 0 2010-08-31 20:18 updated/
[hans@localhost mnt]$

the rsync command I use is:

rsync -axhhX --stats --delete --delete-excluded --backup
--backup-dir-dels=deleted/`date +%Y-%m-%d` --backup-dir=updated/`date +%Y-%m-%d`
--suffix=.`date +%H%M` --log-file=/home/hans/rsync-files/rsync-log.`date
+%Y%m%d-%H%M` --log-file-format="%i %o %f"
--exclude-from=/home/hans/rsync-files/exclude.txt /home/hans /mnt/backup

NB: also the old mailing list thread "rsync 2.6.4 - directory always updated"
from John Stoffel in 2005 did not help me (I'm not that good in *nix file system
stuff)

Best regards,

Hans Troost
 
Old 09-04-2010, 05:19 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by Hans Troost View Post
how to get rid of these lines, while keeping lines like
Best way would be to tune rsync to emit less messages or else you could in- or post-process filter the log. I haven't tried this but maybe rsync can output to stdout but *with* your log formatting if you use something like 'rsync $switches --log-file-format="%i %o %f" $switches $source $target' or else maybe with explicitly setting --log-file destination 'rsync $switches --log-file=/dev/stdout --log-file-format="%i %o %f" $switches $source $target'. If that's the case then you could 0) wedge the filter in between rsync and logfile redirection, else 1) just post-process the log: 0) 'rsync $switches| grep -v $REGEX > logfile' or 'rsync --log-file $LOGFILE.temp $switches && grep -v $REGEX $LOGFILE.temp > $LOGFILE.good'. The full regex looks something like this: "^[0-9]\{4\}/[0-9]\{2\}/[0-9]\{2\}.[0-9]\{2\}:[0-9]\{2\}:[0-9]\{2\}.\[[0-9]\{1,10\}\].\.d\.\{3\}p\.\{5\}.send" but just catching the ".d...p..... send" with "^.*\.d\.\{3\}p\.\{5\}.send" will work fine too.
 
Old 09-04-2010, 08:24 AM   #3
Hans Troost
LQ Newbie
 
Registered: May 2005
Location: The Netherlands
Distribution: PCLinuxOS
Posts: 5

Original Poster
Rep: Reputation: 0
rsync: log-file: howto get rid of ".d...p..... send"

Thanks for your suggestion unSpawn,

In the meanwhile I posted this question also to the more specific rsync mailing list that I discovered later.
Final solution:
  • since it is just a backup for my own single user - me - workstation I decided to take 2 measures:
  • add --no-p (to switch off the implicit -perms from the -a option). Following tips from rsync specialist I used "strace -f rsync --..." and figured out a failure of a chmod. So the settings of the mounted folder on the Lacie Ethernet Minidisk do not permit this chmod. Fine with me: only importance: I have backup of all my files.
  • remove the --log-file-format="%i %o %f" This just lists all the transferred files and their directories (they are of course updated as well)
So I consider this as SOLVED and will mark the thread as such: I both understand what is going on and I am able to get the log-file I want.

 
Old 09-04-2010, 09:03 AM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Excellent. Thanks for posting back the solution!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't get rid of "Stale NFS file handle" disciplepup Linux - Software 4 12-07-2008 07:44 PM
Squid Proxy is unable to log "access.log" file. nishith Linux - Server 6 08-10-2008 12:00 AM
New SQUID user: How to clear the "access.log" and "store.log" automatically? yuzuohong Linux - Networking 2 12-02-2006 05:37 AM
how to get rid of " " spaces in file names in a directory lleb Linux - General 7 08-09-2006 04:08 PM
When "function pointer" meets "template"... I can't get rid of this compiling er cyu021 Linux - Software 3 12-17-2004 07:52 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:37 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration