FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Red Hat Linux

 
 
LinkBack Thread Tools
 
Old 05-29-2010, 10:33 PM
Sanjay Chakraborty
 
Default Argument List too Long

I have a script and that run every month, In the script it has a mv
command and that moves about 35000 files from one directory to other
directory. In one system it is working but in other system I am
getting "Argument List too Long" error message.

mv* ../$directory2/ cannot work.


I can try with "find $directory -type f -name '*' -exec mv {}
$directory2/. ;" but I am not sure it will work and it will take
time to do the testing through script modification.

It is running RHEL 5.1, patching may solve the problem. But I cannot
patch this server soon.

Any one can help about this ?


--
Regards.
Sanjay Chakraborty

--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list
 
Old 05-29-2010, 10:41 PM
Stephen Gilbert
 
Default Argument List too Long

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I'd replace it with a little bash scripting

for a in $ ; do mv "$a" ../$directory2/ ; done



On 5/29/2010 6:33 PM, Sanjay Chakraborty wrote:
> I have a script and that run every month, In the script it has a mv
> command and that moves about 35000 files from one directory to other
> directory. In one system it is working but in other system I am
> getting "Argument List too Long" error message.
>
> mv* ../$directory2/ cannot work.
>
>
> I can try with "find $directory -type f -name '*' -exec mv {}
> $directory2/. ;" but I am not sure it will work and it will take
> time to do the testing through script modification.
>
> It is running RHEL 5.1, patching may solve the problem. But I cannot
> patch this server soon.
>
> Any one can help about this ?
>
>

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.12 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkwBmBMACgkQdBNH6NIpz0XNVwCfSFF9uv8CWy 66CeDQg56Y3P2I
5ZIAmwZ2rVnjkCaiCFDLOsYHVDNvQCak
=IZ43
-----END PGP SIGNATURE-----

--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list
 
Old 05-29-2010, 11:17 PM
"Burke, Thomas G."
 
Default Argument List too Long

Yeah, I've had similar problems in the past. I figured a way to discriminate & made a script that broke them up into groups of a couple hundred or so.


I'm not at my desk, but I can be reached at 443-603-7308

----- Original Message -----
From: redhat-list-bounces@redhat.com <redhat-list-bounces@redhat.com>
To: redhat-list@redhat.com <redhat-list@redhat.com>
Sent: Sat May 29 17:41:23 2010
Subject: Re: Argument List too Long

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I'd replace it with a little bash scripting

for a in $ ; do mv "$a" ../$directory2/ ; done



On 5/29/2010 6:33 PM, Sanjay Chakraborty wrote:
> I have a script and that run every month, In the script it has a mv
> command and that moves about 35000 files from one directory to other
> directory. In one system it is working but in other system I am
> getting "Argument List too Long" error message.
>
> mv* ../$directory2/ cannot work.
>
>
> I can try with "find $directory -type f -name '*' -exec mv {}
> $directory2/. ;" but I am not sure it will work and it will take
> time to do the testing through script modification.
>
> It is running RHEL 5.1, patching may solve the problem. But I cannot
> patch this server soon.
>
> Any one can help about this ?
>
>

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.12 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkwBmBMACgkQdBNH6NIpz0XNVwCfSFF9uv8CWy 66CeDQg56Y3P2I
5ZIAmwZ2rVnjkCaiCFDLOsYHVDNvQCak
=IZ43
-----END PGP SIGNATURE-----

--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list
--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list
 
Old 05-29-2010, 11:22 PM
Stephen Gilbert
 
Default Argument List too Long

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ack, that script should, of course, read

for a in * ; do mv "$a" ../$directory2/ ; done

Sorry for the typo.

On 5/29/2010 7:17 PM, Burke, Thomas G. wrote:
> Yeah, I've had similar problems in the past. I figured a way to discriminate & made a script that broke them up into groups of a couple hundred or so.
>
>
> I'm not at my desk, but I can be reached at 443-603-7308
>
> ----- Original Message -----
> From: redhat-list-bounces@redhat.com <redhat-list-bounces@redhat.com>
> To: redhat-list@redhat.com <redhat-list@redhat.com>
> Sent: Sat May 29 17:41:23 2010
> Subject: Re: Argument List too Long
>
> I'd replace it with a little bash scripting
>
> for a in $ ; do mv "$a" ../$directory2/ ; done
>
>
>
> On 5/29/2010 6:33 PM, Sanjay Chakraborty wrote:
>> I have a script and that run every month, In the script it has a mv
>> command and that moves about 35000 files from one directory to other
>> directory. In one system it is working but in other system I am
>> getting "Argument List too Long" error message.
>
>> mv* ../$directory2/ cannot work.
>
>
>> I can try with "find $directory -type f -name '*' -exec mv {}
>> $directory2/. ;" but I am not sure it will work and it will take
>> time to do the testing through script modification.
>
>> It is running RHEL 5.1, patching may solve the problem. But I cannot
>> patch this server soon.
>
>> Any one can help about this ?
>
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.12 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkwBodMACgkQdBNH6NIpz0UWjACg25FMEeKPXT 6AYqLjQ1lqPnVL
4fsAniZPbBt3FYDW+oA4f0EeufTQpbi1
=85XO
-----END PGP SIGNATURE-----

--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list
 
Old 05-29-2010, 11:41 PM
Aaron Bliss
 
Default Argument List too Long

You may also wish to try moving the files in smaller batches to work
around the problem. For example, find ./ -mtime +21 -type f | xargs mv
../ ; find ./ -mtime +14 -type f | xargs mv ../ ; etc.


Aaron

On 5/29/2010 7:22 PM, Stephen Gilbert wrote:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ack, that script should, of course, read

for a in * ; do mv "$a" ../$directory2/ ; done

Sorry for the typo.

On 5/29/2010 7:17 PM, Burke, Thomas G. wrote:

Yeah, I've had similar problems in the past. I figured a way to discriminate& made a script that broke them up into groups of a couple hundred or so.


I'm not at my desk, but I can be reached at 443-603-7308

----- Original Message -----
From: redhat-list-bounces@redhat.com<redhat-list-bounces@redhat.com>
To: redhat-list@redhat.com<redhat-list@redhat.com>
Sent: Sat May 29 17:41:23 2010
Subject: Re: Argument List too Long

I'd replace it with a little bash scripting

for a in $ ; do mv "$a" ../$directory2/ ; done



On 5/29/2010 6:33 PM, Sanjay Chakraborty wrote:

I have a script and that run every month, In the script it has a mv
command and that moves about 35000 files from one directory to other
directory. In one system it is working but in other system I am
getting "Argument List too Long" error message.



mv* ../$directory2/ cannot work.




I can try with "find $directory -type f -name '*' -exec mv {}
$directory2/. ;" but I am not sure it will work and it will take
time to do the testing through script modification.



It is running RHEL 5.1, patching may solve the problem. But I cannot
patch this server soon.



Any one can help about this ?





-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.12 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkwBodMACgkQdBNH6NIpz0UWjACg25FMEeKPXT 6AYqLjQ1lqPnVL
4fsAniZPbBt3FYDW+oA4f0EeufTQpbi1
=85XO
-----END PGP SIGNATURE-----



--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list
 
Old 05-30-2010, 01:42 AM
"Carl T. Miller"
 
Default Argument List too Long

Sanjay Chakraborty wrote:
> I have a script and that run every month, In the script it has a mv
> command and that moves about 35000 files from one directory to other
> directory. In one system it is working but in other system I am
> getting "Argument List too Long" error message.
>
> mv* ../$directory2/ cannot work.

Try this:

ls | while read file; do mv "$file" ../$directory2; done

c


--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list
 
Old 05-30-2010, 02:40 AM
Cliff
 
Default Argument List too Long

Why not just use xargs?

Sent from my iPhone

On May 29, 2010, at 9:42 PM, "Carl T. Miller" <carl@carltm.com> wrote:


Sanjay Chakraborty wrote:

I have a script and that run every month, In the script it has a mv
command and that moves about 35000 files from one directory to other
directory. In one system it is working but in other system I am
getting "Argument List too Long" error message.

mv* ../$directory2/ cannot work.


Try this:

ls | while read file; do mv "$file" ../$directory2; done

c


--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list


--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list
 
Old 05-30-2010, 03:34 AM
"Geofrey Rainey"
 
Default Argument List too Long

Hi,

I'm not the original poster but am interested in this thread and in
particular the "xargs" command. I'm not familiar with it, what is it and
how does one use it?

thanks.

-----Original Message-----
From: redhat-list-bounces@redhat.com
[mailto:redhat-list-bounces@redhat.com] On Behalf Of Cliff
Sent: Sunday, 30 May 2010 2:41 p.m.
To: General Red Hat Linux discussion list
Subject: Re: Argument List too Long

Why not just use xargs?

Sent from my iPhone

On May 29, 2010, at 9:42 PM, "Carl T. Miller" <carl@carltm.com> wrote:

> Sanjay Chakraborty wrote:
>> I have a script and that run every month, In the script it has a mv
>> command and that moves about 35000 files from one directory to other
>> directory. In one system it is working but in other system I am
>> getting "Argument List too Long" error message.
>>
>> mv* ../$directory2/ cannot work.
>
> Try this:
>
> ls | while read file; do mv "$file" ../$directory2; done
>
> c
>
>
> --
> redhat-list mailing list
> unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe
> https://www.redhat.com/mailman/listinfo/redhat-list

--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list
================================================== ========
For more information on the Television New Zealand Group, visit us
online at tvnz.co.nz
================================================== ========
CAUTION: This e-mail and any attachment(s) contain information that
is intended to be read only by the named recipient(s). This information
is not to be used or stored by any other person and/or organisation.


--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list
 
Old 05-31-2010, 06:26 PM
Sanjay Chakraborty
 
Default Argument List too Long

I have a script and that run every month, In the script it has a mv
command and that moves about 35000 files from one directory to other
directory. In one system it is working but in other system I am
getting "Argument List too Long" error message.

mv* ../$directory2/ cannot work.


I can try with "find $directory -type f -name '*' -exec mv {}
$directory2/. ;" but I am not sure it will work and it will take
time to do the testing through script modification.

It is running RHEL 5.1, patching may solve the problem. But I cannot
patch this server soon.

Any one can help about this ?

--
Regards.
Sanjay Chakraborty

--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list
 
Old 06-01-2010, 04:17 PM
cliff here
 
Default Argument List too Long

Look in the man pages for Xargs, there are quite a few examples in there on
how to move and delete file when the 'Argument list is too long'

On Mon, May 31, 2010 at 2:26 PM, Sanjay Chakraborty <sanjaychakrab@gmail.com
> wrote:

> I have a script and that run every month, In the script it has a mv
> command and that moves about 35000 files from one directory to other
> directory. In one system it is working but in other system I am
> getting "Argument List too Long" error message.
>
> mv* ../$directory2/ cannot work.
>
>
> I can try with "find $directory -type f -name '*' -exec mv {}
> $directory2/. ;" but I am not sure it will work and it will take
> time to do the testing through script modification.
>
> It is running RHEL 5.1, patching may solve the problem. But I cannot
> patch this server soon.
>
> Any one can help about this ?
>
> --
> Regards.
> Sanjay Chakraborty
>
> --
> redhat-list mailing list
> unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe
> https://www.redhat.com/mailman/listinfo/redhat-list
>



--
-------------------------------------------------------------------------------------------------------------------------------------
NOTICE: This message, including all attachments, is intended for the use of
the individual or entity to which it is addressed and may contain
information that is privileged, confidential and exempt from disclosure
under applicable law. If the reader of this message is not the intended
recipient, or the employee or agent responsible for delivering this message
to its intended recipient, you are hereby notified that any dissemination,
distribution or copying of this communication is strictly prohibited. If you
have received this communication in error, please notify the sender
immediately by replying "Received in error" and immediately delete this
message and all its attachments.
-------------------------------------------------------------------------------------------------------------------------------------
--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list
 

Thread Tools




All times are GMT. The time now is 08:59 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org