How to Solve Error rsync : Argument list too long

Posted on

This article is actually about how to solve the error message upon executing rsync command in the terminal or any text-based command line interface. As shown in the title of the article, the command, specifically the ‘rsync’ command is executed in the command line interface or in the terminal. Based on the manual page, it is a command described as a command for a fast, versatile, remote or local file-copying tool. But upon executing that command, in order to copy certain files or folders located in a certain path to another path. In the context of this article, it is used to synchronize the available files or folders which exist in the first location or it can be called as the source location to the second location which is actually can be called as the target location.

Below is the actual pattern :

rsync parameter source target

Apparently, upon executing the command, there is an error message generated as shown in the title of this article which is exactly as follows :

user@hostname:/var/www/html$ rsync -avz /images/* /home/user/images/
-bash: /usr/bin/rsync: Argument list too long
user@hostname:/var/www/html$

So, basically, the above command executed is actually a command for copying all the available files or folders located in a location or folder named ‘images’ to another specific location or folder in another different place which is also called ‘images’. The purpose of giving the ‘*’ after the name of the source folder is none other to specify or to mention all of the files and folders exist inside the folder named ‘images’. But in this context, that is the mistake which is actually generating the error message. So, in order to solve the above problem and execute the command successfully, just omit the ‘*’ sign. And re-execute the above command as follows :

user@hostname:/var/www/html$ rsync -avz /images/ /home/user/images/
sending incremental file list
./
xxxxxxxxxx.jpg
xxxxxxxxxx.png
xxxxxxxxxx.gif
sent 29274506 bytes received 72 bytes 19516385.33 bytes/sec
total size is 321717270 speedup is 10.99
user@hostname:/var/www/html$

As shown in the above command executed, the command has already executed successfully by looking at the transfer or the copy progress above from the ‘images’ folder to the target location of another ‘images’ folder in another place

One thought on “How to Solve Error rsync : Argument list too long

Leave a Reply