[Gllug] bash script to find, list and save log
Jonathan Dye
jonathan.dye at automationpartnership.com
Wed Aug 20 10:00:32 UTC 2003
Liam Delahunty wrote:
> I have the following find command to get all the mail spool
> files that have been updated in the last day.
>
> find /home/spool/mail -mtime -1 \! -type d -exec ls -lh '{}' ';'
> -print | sort >> /tmp/spool.mail.daily.log
>
> which produces results such as:
>
> line1: -rw------- 1 user1 home 1.9M Aug 20 08:40
> /home/spool/mail/user1 line2: -rw------- 1 user2 home 0
> Aug 20 10:13 /home/spool/mail/user2 line3: /home/spool/mail/user1
> line4: /home/spool/mail/user2
>
> I don't want the extra /home/spool/mail/userx lines 3 and 4...
>
> Could some kind soul tell me what I've done wrong in my command?
Remove the -print.
JD
_____________________________________________________________________
This message has been checked for all known viruses by the
MessageLabs Virus Scanning Service
--
Gllug mailing list - Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug
More information about the GLLUG
mailing list