Stefan Mosleitner
2008-Oct-28 14:30 UTC
Include/Exclude Pattern for rsync ONLY the latest file of the src dir
Hi, Is it possible to selcect a particular source directory and filter/select ONLY the latest file in this directory for rsync?
Matt McCutchen
2008-Oct-28 14:45 UTC
Include/Exclude Pattern for rsync ONLY the latest file of the src dir
On Tue, 2008-10-28 at 14:58 +0100, Stefan Mosleitner wrote:> Is it possible to selcect a particular source directory and filter/select > ONLY the latest file in this directory for rsync?Selection of the latest file is not built into rsync, but it can be scripted easily: rsync OPTION... SRC/"$(ls -t1 SRC | head -n 1)" DEST/ Or you can do something like --include="$(ls -t1 SRC | head -n 1)" --exclude='*' if you prefer. Matt