I have the following rsync set up, which is supposed to sync CDR files created during the past day.
rsync -av root@vpsrv:'$(find /home/cdrs/*.cdr -type f -ctime -1)' /home/cdrs
However, if no files are found, then this command will sync the entire /root
directory for some reason. I've even tried to prevent this by adding include=
filter:
rsync -av --include="*.cdr" root@vpsrv:'$(find /home/cdrs/*.cdr -type f -ctime -1)' /home/cdrs
Or even grepping for *.cdr:
rsync -av --include="*.cdr" root@vpsrv:'$(find /home/cdrs/*.cdr -type f -ctime -1 | grep *.cdr)' /home/cdrs
but no luck. Do you have any ideas?