LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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, 09: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 09:50 PM.
 
Old 01-08-2012, 11:50 PM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,348

Rep: Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749
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, 12:03 AM   #3
Valery Reznic
ELF Statifier author
 
Registered: Oct 2007
Posts: 676

Rep: Reputation: 137Reputation: 137
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, 12: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
execvp: /bin/sh: Argument list too long - Compilation Error sahil.jammu Linux - Software 7 03-31-2020 08:32 AM
How to face the error "Argument list too long" in bash? wasim_jd Linux - Newbie 8 12-04-2011 05:43 AM
Argument list too long - Compilation Error sahil.jammu Linux - Software 5 07-24-2009 01:45 AM
Argument list too long error on Centos 5.1 xtremeclones Linux - Software 5 09-10-2008 07:46 PM
Combines 16000 files into 1 single file > error tb: /bin/cat: Argument list too long guanyu Linux - General 4 02-09-2007 12:33 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:36 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
Open Source Consulting | Domain Registration