public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] Any way around "Argument list too long"?
@ 2011-07-17 19:32 Grant
  2011-07-17 19:42 ` Alan Mackenzie
                   ` (3 more replies)
  0 siblings, 4 replies; 25+ messages in thread
From: Grant @ 2011-07-17 19:32 UTC (permalink / raw
  To: Gentoo mailing list

My crontab deletes all files of a certain type in a certain folder
with yesterday's date in the filename.  It usually executes but
sometimes fails with:

/bin/rm: Argument list too long

What would you do about this?

- Grant



^ permalink raw reply	[flat|nested] 25+ messages in thread
* RE: [gentoo-user] Any way around "Argument list too long"?
@ 2011-07-17 19:54 Pandu Poluan
  2011-07-17 21:51 ` Michael Mol
  0 siblings, 1 reply; 25+ messages in thread
From: Pandu Poluan @ 2011-07-17 19:54 UTC (permalink / raw
  To: gentoo-user

-original message-
Subject: Re: [gentoo-user] Any way around "Argument list too long"?
From: Alan Mackenzie <acm@muc.de>
Date: 2011-07-18 02:42

>Hi, Grant.
>
>On Sun, Jul 17, 2011 at 12:32:42PM -0700, Grant wrote:
>> My crontab deletes all files of a certain type in a certain folder
>> with yesterday's date in the filename.  It usually executes but
>> sometimes fails with:
>
>> /bin/rm: Argument list too long
>
>> What would you do about this?
>
>Use xargs - in place of
>    /bin/rm lots of files ......
>
>Use
>   Lots_of_file_names | xargs rm
>
>.  xargs then calls rm several times with batches of filenames each time.
>xargs is a standard Unix command.

You'll want to be extra careful with special characters like (space), single quote, and double quote.

Better use find ..... -exec rm {} +

See: http://en.m.wikipedia.org/wiki/Xargs


Rgds,
--
FdS Pandu E Poluan
~ IT Optimizer ~

Sent from Nokia E72-1





^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2011-07-20  8:55 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-17 19:32 [gentoo-user] Any way around "Argument list too long"? Grant
2011-07-17 19:42 ` Alan Mackenzie
2011-07-17 19:52 ` victor romanchuk
2011-07-17 19:53 ` David W Noon
2011-07-17 23:23   ` Grant
2011-07-17 23:36     ` Michael Mol
2011-07-17 23:37     ` Alan McKinnon
2011-07-18  0:47       ` Grant
2011-07-18  1:05         ` Albert Hopkins
2011-07-18  1:40           ` Grant
2011-07-18  8:48             ` Neil Bothwick
2011-07-18 21:56               ` Grant
2011-07-19 13:58               ` Florian Philipp
2011-07-19 14:24                 ` Neil Bothwick
2011-07-19 18:24                 ` Grant
2011-07-19 19:28                   ` David W Noon
2011-07-20  8:54                 ` Joost Roeleveld
2011-07-17 21:14 ` Alan McKinnon
2011-07-17 22:06   ` [gentoo-user] " walt
2011-07-17 22:31     ` Mick
2011-07-17 22:35     ` Alan McKinnon
2011-07-17 23:16       ` Neil Bothwick
2011-07-17 23:43         ` Alan McKinnon
  -- strict thread matches above, loose matches on Subject: below --
2011-07-17 19:54 [gentoo-user] " Pandu Poluan
2011-07-17 21:51 ` Michael Mol

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox