LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   argument list too long error (https://www.linuxquestions.org/questions/linux-newbie-8/argument-list-too-long-error-922792/)

linuxandtsm 01-08-2012 09:48 PM

argument list too long error
 
Hi all,

I am getting this error when i run a bash script.
Code:

/home/user/testscript.sh: line 32: /usr/bin/rsync: Argument list too long
and below is the command at line 32 in the testscript.sh

Code:

rsync -rltcv /dir1/dir2/dir3/dir4/dir5/*  /target1/target2/ >> $LOG
thanks in advance!

chrism01 01-08-2012 11:50 PM

It would usually mean there are too many dirs/files in the generated list for rsync to handle.
Try adding
Code:

set -xv
at the top of your sh file (after the #!/bin/bash line) to see.
You may need to break it down into multiple smaller file lists.

Valery Reznic 01-09-2012 12:03 AM

Code:

rsync -rltcv /dir1/dir2/dir3/dir4/dir5/*  /target1/target2/ >> $LOG
Why yo need a '*' ?


Code:

rsync -rltcv /dir1/dir2/dir3/dir4/dir5/  /target1/target2/ >> $LOG
This command will not do?

linuxandtsm 01-09-2012 12:55 PM

Thanks for the replies.

removing '*' at the end of source dir, worked.


All times are GMT -5. The time now is 11:00 PM.