On Tue, 25 Jun 2002, Nikolaus Hiebaum wrote:
Hello -
I am using the backup mechanism described in the procmailex.
:0 c
backup
:0 ic
| cd backup && rm -f dummy `ls -t msg.* | sed -e 1,36d`
The messages in the backuop folder look like this one: msg.tVmI
It's hard to find out which is the one I may be looking for. :)
How can I make the part after the msg. to - say - be composed of year,
month, and date?
I tried this:
| cd backup && rm -f dummy `ls -t msg.`date +%d%m%Y_%H%M`| sed -e 1,36d`
but to no avail.
Any suggestions?
Try to make directory witch named by the date:
D=`date '+%m%d'`
:0 c
* ? mkdir -p /var/spool/backup.${D}
/var/spool/backup.${D}
:0 ic
| ls /var/spool/backup.* | head -36 | xargs rm -rf
Or name the folder (not directory) by date:
D=`date '+%m%d'`
:0 c
/var/spool/backup/${D}
:0 ic
| ls /var/spool/backup/* | head -36 | xargs rm -rf
Bye,
Udi
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail