file handling

Copying a large set of files

Today I found myself needing to copy a very large number of files from one server to another. My standard tool for these things is usually scp, but in this case it didn't work due to the fact that i needed to copy a large subset of files within a directory. In other words, I didn't want to copy server:directory – but server:directory/*pattern*. This is definitely possible with scp, but because *pattern* returned so many files in this case, I recieved the error message Argument list too long.

I found a handy solution for this, but first let's take a look at the reason behind this error message.

Syndicate content
Byt till svenska