Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Rsync Option

Status
Not open for further replies.

fmuquartet

Programmer
Sep 21, 2006
60
US
Greetings,
At the moment I am wanting to **only** send recent changed files from client machines via 'find /dir*/log -mtime -1-print' which works, but now I am wanting to pipe this output to '/usr/local/bin/rync.'

I found something that should work for this, but when running it in a borne shell script it get errors:

The script is as follows:
rsync --rsync-path='rsync --files-from=<(cd src && find . -atime +6 -print)' \
remote:src/ dest/

So in my case this is what I tried:

#!/bin/sh
/usr/local/bin/rsync --rsync-path=/usr/local/bin/rsync --files-from=<(cd /opt/foo && find dir*/log -print)


has anyone any experience in this arena?
 
Hi,

Apologies if I have mis-interpreted your desired results.
But do you need to pipe the find command into rsync.

Rsync will only update the changed files by default from source to destination. It would therefore keep file structures the same on each side of the sync.

It sounds like you don't need rsync at all if you are just copying recently changed files.
Or if you are actually syncing systems then you don't need the find command.
I hope this makes sense, as I have just confused myself.
I am however quite hungover.

Alan
 
AnotherAlan,

At present I am using rsync to sync files between remote and local systems (Which works fine). Because of a bandwidth constraint, I am wanting to now linit the synchronization down to only those files that have been access for that day (find . -mtime -1 -print) and pipe the results to rsync.

From my understanding, the --files-from option supports this, just not having much luck get it to work.

Thanks!
 
Hi again,

OK, I think one of us is getting confused.
Rsync will only copy the changes. So your bandwith issues should not be a concern.

You could also look at the rdist utility which does something akin to that which you require.

Again, apologies if I haven't grasped your actual problem, but it does read that you only wish to copy changes, in which case rsync is your command.

Good luck
Alan
 
Another Alen,
So are you saying that rsync doesn't support anything like:
(cd src && find . -atime +6 -print) | rsync --files-from=- src/ dest/

As this is what I am ultimately wanting to do.
 
I will seek another method for gathering the information needed, again thanks for the info.
 
Hi fmuquartet,

I'm not saying that the syntax is not supported, I just don't understand the requirement or the need to pipe the output of a find command ( listing recently changed / accessed files ) into an rsync command.

Did you look into rdist as I suggested previously?
I think this may be of interest to you.

Sorry I couldn't help further.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top