[rt-users] rm sessiondata from crontab...

Bob Apthorpe arclight at jump.net
Fri Jan 18 13:14:46 EST 2002


Hi,

Also, for efficiency/reliability purposes you might want to try:

/usr/bin/find /opt/rt2/WebRT/sessiondata -type f -amin +600 -print |
/usr/bin/xargs -i /bin/rm '{}'

IIRC, -exec is kind of a resource hog. xargs gets around limits on 
number of arguments because -exec can crap out if the number of 
files returned is large. xargs is pretty useful but not well advertised.

hth,

-- Bob

On 18 Jan 2002, at 11:49, Adrian Galindo wrote:

> Kristopher Lalletti escribió:
> > 
> > I'm trying to get find with -exec to work .. and I'm not getting any
> > luck
> > 
> > Here's the cmdline from the RT docs, for the -exec , syntax looks
> > great from the man pages, but I keep getting "/usr/bin/find: missing
> > argument to `-exec'".
> > 
> > /usr/bin/find /opt/rt2/WebRT/sessiondata -type f -amin +600 -exec
> > /bin/rm '{}' ;
> > 
> > Any ideas?   I wouldn't be surprised that RedHat 7.2 would use some
> > sort of their own /usr/bin/find, but I want to make sure if I'm not
> > missing something..
> 
> You miss the backslash at the end.
> The correct is:
> /usr/bin/find /opt/rt2/WebRT/sessiondata -type f -amin +600 -exec
> /bin/rm '{}' \;
> 
> man find for more information.
> 
> Greetings
> Adrian Galindo
> 
> _______________________________________________
> rt-users mailing list
> rt-users at lists.fsck.com
> http://lists.fsck.com/mailman/listinfo/rt-users
> 






More information about the rt-users mailing list