arg list too long

arg list too long

Post by Bing D » Sun, 18 Nov 2001 00:47:51



Hi,

I need to copy about 20,000 files from one Solaris to another one.  The
following command gives 'arg list too long':


I ever used xargs to change the ownership of a large number of files
using the following command:

find . -name test-\* -print | xargs chown user:group

I just don't know how 'xargs' can be used with scp.

Any help is appreciated.

Bing

 
 
 

arg list too long

Post by quen.. » Sun, 18 Nov 2001 01:59:17



> Hi,

> I need to copy about 20,000 files from one Solaris to another one.  The
> following command gives 'arg list too long':



slower but you could put it in a for loop

or depending on your version of ssh you could do scp -r $LOCALDIR
$REMOTEHOST:$DIR

not sure about your chowning (do it when they arrive on the remote host
?)

Quote:> I ever used xargs to change the ownership of a large number of files
> using the following command:

> find . -name test-\* -print | xargs chown user:group

> I just don't know how 'xargs' can be used with scp.

> Any help is appreciated.

> Bing

--
#####################
Quentyn Taylor
Sysadmin - Fotango
#####################
"Persons compelled to habitate in structures of patent frangibility
should, under no
circumstances, employ fragmentations of the lithosphere as projectiles."

 
 
 

arg list too long

Post by Hanspeter 'Happl' Oberli » Sun, 18 Nov 2001 02:29:52




>I need to copy about 20,000 files from one Solaris to another one.  The
>following command gives 'arg list too long':

>I ever used xargs to change the ownership of a large number of files
>using the following command:
>find . -name test-\* -print | xargs chown user:group



(on my AIX boxes I have to use the -i option).


{} stands for the actual file name.

Greetings from Switzerland -- Gruesse aus der Schweiz
Happl

 
 
 

arg list too long

Post by Bing D » Sun, 18 Nov 2001 02:22:22


If using for loop, how should I automatically enter the password prompted by
scp for each file?

Bing



> > Hi,

> > I need to copy about 20,000 files from one Solaris to another one.  The
> > following command gives 'arg list too long':


> slower but you could put it in a for loop

> or depending on your version of ssh you could do scp -r $LOCALDIR
> $REMOTEHOST:$DIR

> not sure about your chowning (do it when they arrive on the remote host
> ?)

> > I ever used xargs to change the ownership of a large number of files
> > using the following command:

> > find . -name test-\* -print | xargs chown user:group

> > I just don't know how 'xargs' can be used with scp.

> > Any help is appreciated.

> > Bing

> --
> #####################
> Quentyn Taylor
> Sysadmin - Fotango
> #####################
> "Persons compelled to habitate in structures of patent frangibility
> should, under no
> circumstances, employ fragmentations of the lithosphere as projectiles."

 
 
 

arg list too long

Post by quen.. » Sun, 18 Nov 2001 03:11:19



> If using for loop, how should I automatically enter the password prompted by
> scp for each file?

> Bing



> > > Hi,

> > > I need to copy about 20,000 files from one Solaris to another one.  The
> > > following command gives 'arg list too long':


> > slower but you could put it in a for loop

> > or depending on your version of ssh you could do scp -r $LOCALDIR
> > $REMOTEHOST:$DIR

> > not sure about your chowning (do it when they arrive on the remote host
> > ?)

> > > I ever used xargs to change the ownership of a large number of files
> > > using the following command:

> > > find . -name test-\* -print | xargs chown user:group

> > > I just don't know how 'xargs' can be used with scp.

> > > Any help is appreciated.

> > > Bing

> > --
> > #####################
> > Quentyn Taylor
> > Sysadmin - Fotango
> > #####################
> > "Persons compelled to habitate in structures of patent frangibility
> > should, under no
> > circumstances, employ fragmentations of the lithosphere as projectiles."

errr well spotted

you can distribute your public key and set up no passowrd on your local
key (bad idea but if it only for that session... )

or use ssh-agent (depending on the version...)

Q (the master of ....)

--
#####################
Quentyn Taylor
Sysadmin - Fotango
#####################
Never anger a dragon, for you are crunchy and good with ketchup.

 
 
 

arg list too long

Post by Barry Margoli » Sun, 18 Nov 2001 04:03:46






>>I need to copy about 20,000 files from one Solaris to another one.  The
>>following command gives 'arg list too long':

>>I ever used xargs to change the ownership of a large number of files
>>using the following command:
>>find . -name test-\* -print | xargs chown user:group




Won't these run into the same "arg list too long" problem?  If the shell
can't handle that many arguments when it runs scp, why would it be any
happier when the command is ls?  I think you meant:


Without the wildcard, the shell never tries to insert all the filenames
into the command line.

--

Genuity, Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.

 
 
 

arg list too long

Post by Bing D » Sun, 18 Nov 2001 07:17:23







> >>I need to copy about 20,000 files from one Solaris to another one.  The
> >>following command gives 'arg list too long':

> >>I ever used xargs to change the ownership of a large number of files
> >>using the following command:
> >>find . -name test-\* -print | xargs chown user:group



> Won't these run into the same "arg list too long" problem?  If the shell
> can't handle that many arguments when it runs scp, why would it be any
> happier when the command is ls?  I think you meant:

'ls *' does run into 'arg list too long'.


> Without the wildcard, the shell never tries to insert all the filenames
> into the command line.

Although 'ls' doesn't, what if I just want to copy over the files that follow some
specific pattern?

In addition, I can not bypass the password checking.  I don't mind entering the

loop.  It asks for password before tranferring each file.  That's not desirable.

Bing

 
 
 

arg list too long

Post by Barry Margoli » Sun, 18 Nov 2001 07:45:45



Quote:>Although 'ls' doesn't, what if I just want to copy over the files that
>follow some
>specific pattern?

Then you should use "find", as others have shown.

>In addition, I can not bypass the password checking.  I don't mind entering the

>runs as a
>loop.  It asks for password before tranferring each file.  That's not desirable.

Someone else suggested setting up an appropriate certificate so that it
will run without prompting for a password.

--

Genuity, Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.

 
 
 

arg list too long

Post by <dphilli.. » Sun, 18 Nov 2001 09:11:12


    In order to get around scping all the files over individually, and
entering a password each time, have you thought of taring up the directory
and scping them all over in one shot?  Then all you have to do is untar it
once you get it over there.  If you do indeed want all the files, and I
expect that's why you used *, this might be the way to go.
    Good luck.







> > >>I need to copy about 20,000 files from one Solaris to another one.
The
> > >>following command gives 'arg list too long':

> > >>I ever used xargs to change the ownership of a large number of files
> > >>using the following command:
> > >>find . -name test-\* -print | xargs chown user:group



> > Won't these run into the same "arg list too long" problem?  If the shell
> > can't handle that many arguments when it runs scp, why would it be any
> > happier when the command is ls?  I think you meant:

> 'ls *' does run into 'arg list too long'.


> > Without the wildcard, the shell never tries to insert all the filenames
> > into the command line.

> Although 'ls' doesn't, what if I just want to copy over the files that
follow some
> specific pattern?

> In addition, I can not bypass the password checking.  I don't mind
entering the

runs as a
> loop.  It asks for password before tranferring each file.  That's not
desirable.

> Bing

 
 
 

arg list too long

Post by Barry Margoli » Sun, 18 Nov 2001 09:20:31




>    In order to get around scping all the files over individually, and
>entering a password each time, have you thought of taring up the directory
>and scping them all over in one shot?  Then all you have to do is untar it
>once you get it over there.  If you do indeed want all the files, and I
>expect that's why you used *, this might be the way to go.

You can do it in one command:

tar cf - . | ssh -l user host tar xfC - /home/user

I believe scp is implemented on top of ssh, so if he can scp he should be
able to ssh.

--

Genuity, Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.

 
 
 

arg list too long

Post by Alan Coopersmi » Mon, 19 Nov 2001 16:48:56



|I need to copy about 20,000 files from one Solaris to another one.  The
|following command gives 'arg list too long':
|

If you really want to copy the entire contents of the directory, why not
simply:

--
________________________________________________________________________


  Working for, but definitely not speaking for, Sun Microsystems, Inc.

 
 
 

1. sco-list: arg list too long

man xargs

Bill
--

UUCP:               camco!bill  PO Box 820; 2835 82nd Avenue S.E. S-100
FAX:            (206) 232-9186  Mercer Island, WA 98040-0820; (206) 236-1676
URL: http://www.celestial.com/

A child can go only so far in life without potty training.  It is not
mere coincidence that six of the last seven presidents were potty
trained, not to mention nearly half of the nation's state legislators.
                -- Dave Barry

2. AIX and Solaris Administrator Jobs in Florida

3. arg list too long: help?

4. libXpm error with new install

5. /bin/ls: arg list too long

6. Top 10 posters comp.unix.shell

7. Arg list too long

8. Newbie Q -> How do I create a DHCP client on ISP who doen't allow fixed IP?

9. grep: cannot execute [Arg list too long] ???

10. ODT - ksh: /bin/ls: arg list too long

11. err: arg list too long

12. arg list too long

13. Arg list too long