Page 1 of 1

rsync problem: "argument list too long"

Posted: Thu Oct 17, 2013 10:37 am
by ^rooker
[PROBLEM]
I just wanted to copy a folder with 4 hours of video frames to another. In PAL, with 25 fps, that's 360000 images in one folder.

Since I'm using rsync whenever I need to be sure that the copy worked, and especially with so many files, I ran into a problem.

Doing something like this:

Code: Select all

rsync -avP /source/directory/with/all/the/files/*.png /target/folder/
returned the error:
bash: /usr/bin/rsync: Argument list too long
If I understood this correctly, it isn't actually rsync's fault, but BASH's.

[SOLUTION]
Thanks to a a blog post by Stuart on sr128.org, I found an answer for the case where you wanted to copy all files anyway:

Replace the filemask with a dot:

Code: Select all

rsync -avP /source/directory/with/all/the/files/. /target/folder/