LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-08-2012, 10:48 PM   #1
linuxandtsm
Member
 
Registered: May 2011
Posts: 194

Rep: Reputation: Disabled
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!

Last edited by linuxandtsm; 01-08-2012 at 10:50 PM.
 
Old 01-09-2012, 12:50 AM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
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.
 
Old 01-09-2012, 01:03 AM   #3
Valery Reznic
ELF Statifier author
 
Registered: Oct 2007
Posts: 675

Rep: Reputation: 136Reputation: 136
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?
 
1 members found this post helpful.
Old 01-09-2012, 01:55 PM   #4
linuxandtsm
Member
 
Registered: May 2011
Posts: 194

Original Poster
Rep: Reputation: Disabled
Thanks for the replies.

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


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to face the error "Argument list too long" in bash? wasim_jd Linux - Newbie 8 12-04-2011 06:43 AM
Argument list too long - Compilation Error sahil.jammu Linux - Software 5 07-24-2009 02:45 AM
execvp: /bin/sh: Argument list too long - Compilation Error sahil.jammu Linux - Software 5 05-03-2009 10:30 PM
Argument list too long error on Centos 5.1 xtremeclones Linux - Software 5 09-10-2008 08:46 PM
Combines 16000 files into 1 single file > error tb: /bin/cat: Argument list too long guanyu Linux - General 4 02-09-2007 01:33 AM


All times are GMT -5. The time now is 12:35 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration