[TriLUG] Script error?

Brian Henning lugmail at cheetah.dynip.com
Wed Jul 13 22:20:21 EDT 2005


I'm guessing that you get the alert when there's nothing in the directory
that matches your grep statements, which results in the rm command not
having any arguments.  Give rm a -f and it'll stop complaining, I think.
Yep, testing confirms this.  Just put a -f right between rm and your first
backtick.

huh? % rm
rm: too few arguments
huh? % rm -f
huh? %

Of course, always be extraordinarily careful when using -f with any command
which offers it, particularly rm..

Cheers,
~Brian


-----Original Message-----
From: trilug-bounces at trilug.org [mailto:trilug-bounces at trilug.org]On
Behalf Of Lisa C Boyd
Sent: Wednesday, July 13, 2005 9:53 PM
To: Triangle Linux Users Group discussion list
Subject: [TriLUG] Script error?


I've got a cron job setup to delete SquirrelMail attachments that are 2
days old (in the spool directory). I'm getting an email from Cron saying
that "rm: too few arguments" - here's the line from crontab:

rm `find /var/spool/squirrelmail/attach -atime +2 | grep -v "\." | grep
-v _`

It is all on one line, but there is nothing in the directory to be
deleted. Is there something I need to add or change to get rid of this
email alert?

Thanks :)
Lisa B.
--
TriLUG mailing list        : http://www.trilug.org/mailman/listinfo/trilug
TriLUG Organizational FAQ  : http://trilug.org/faq/
TriLUG Member Services FAQ : http://members.trilug.org/services_faq/
TriLUG PGP Keyring         : http://trilug.org/~chrish/trilug.asc




More information about the TriLUG mailing list