I have a semi-working
rsynccommand that I have combined with the
find command on a linux box to do a simple file transfer of a specific type and date.
Here's the command:
rsync -avx --timeout=30 --ignore-existing admin@host:'`find /results/analysis/ -mtime -1 -type f -iname "*.xq"`' /home/serverdir/
Here's the problem:
The above command works perfectly if any files are found. It breaks when no files are found and actually sends a file that is located on the home directory of the remote machine for some reason, which by the way is much older than 1 day as indicated by -mtime.
The error message:
receiving incremental file list ./ rsync: send_files failed to open "/home/admin/.viminfo": Permission denied (13) file.txt
It's as if when the
find command reports nothing, rsync just defaults to sending everything in the home directory. Any ideas of how to fix this?