[Dovecot] OT: Cron Output When Deleting Files

tomas at tuxteam.de tomas at tuxteam.de
Tue Oct 16 17:19:19 EEST 2007


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

On Tue, Oct 16, 2007 at 03:17:06PM +0200, Steffen Kaiser wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> On Tue, 16 Oct 2007, Jeff Grossman wrote:
> 
> >find ./ -type f -ctime +14 | xargs rm
> >
> >I don't know that much about bash scripting.  I would like the output to 
> >tell me how many files were deleted.  Can anybody share with me how can I 
> >get that done, or point in the correct direction?
> 
> 
> find ./ -type f -ctime +14 |tee /tmp/find-rm | xargs rm
> wc -l /tmp/find-rm
> rm /tmp/find-rm

Or, having the right version of rm:

find ./ -type f -ctime +14 | xargs rm -v | wc -l

regards
- -- tomas
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFHFMhnBcgs9XrR2kYRAlY5AJsHaVgFfM/3fZHX8afVSqZjD9GBMACeKD0a
Zm2ZzYfl4S6olYb2a7oz49g=
=9uRg
-----END PGP SIGNATURE-----



More information about the dovecot mailing list