I want to write a acript where it will check for the latest time stamp and then rysnc it to the remote site.Any pinters on this will be highly appreciated.
I want to rsync the files which gets generated every day to a remote destination.I want to write a script which will check the time stamp of the files and will rsync the latest one.
Hmm... rsync is designed to keep two sets of files synchronised, so ideally you should have the same amount of space on both the source and destination. If you are just copying specific files I would use scp.
Anyway, one thing you could do is find /source/dir -type f -mtime -1 | while read f ; do rsync $f destinationhost:/destdir or something along those lines to only transfer files updated in the last 24 hours.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.