rsync problem: "argument list too long"

Linux howto's, compile information, information on whatever we learned on working with linux, MACOs and - of course - Products of the big evil....
Post Reply
User avatar
^rooker
Site Admin
Posts: 1483
Joined: Fri Aug 29, 2003 8:39 pm

rsync problem: "argument list too long"

Post 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/
Jumping out of an airplane is not a basic instinct. Neither is breathing underwater. But put the two together and you're traveling through space!
Post Reply