2

I'm trying to replace my cp function by an rsync function My cp function is the following

find /home/odroid/USBHD/Movies/ -iname "*.mkv" -mtime '-1' -exec cp -n {} /home/odroid/NASVD/Movies \; 

do you guys have any idea how to do this(note the mtime can also be replaced by --ignore-existing

3
  • Please refer to the answer here on how to use rsync with find. Commented Sep 27, 2014 at 18:24
  • Well.. Unfortunately I can not seem to get that to work. Commented Sep 27, 2014 at 20:16
  • What are you trying to do exactly? Do you want to replace cp -n by rsync with the right options, or do you want to replace the whole command line? When you say “the mtime can also be replaced by --ignore-existing”, do you mean that copying all files but ignoring already-existing files would be ok, in which case, why isn't rsync -a --ignore-existing /home/odroid/USBHD/Movies/ /home/odroid/NASVD/Movies/ ok? Commented Sep 27, 2014 at 23:36

1 Answer 1

2
find /home/odroid/USBHD/Movies/ -iname "*.mkv" -mtime '-1' -print0 | xargs -0 -I{} rsync -a --ignore-existing {} /home/odroid/NASVD/Movies/ 

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.