Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
bash script - save mailbox messages.
Right now I am doing this manually and would like this automated. This is how I am doing it now.
I go to my mail archive folder and type:
> s 1-### mbox.temp###
> d 1-###
Now if the number of messages were the same everyday then I would be able to do this a lot easier. Since I dont know if there is any wild cards I could use for the total number of messages does anyone know another way to do this?
- Join Date
- May 2011
- Austin, TX
#!/bin/sh cp mbox mbox.`date +%F` && gzip mbox.`date +%F` && : > mbox
Last edited by dayid; 04-14-2012 at 02:11 AM. Reason: clarify
well I know this is old but I figured out how to do it. It was so simple I feel bad that I didn't think of it sooner. The good new is I have automated this process and removed it from my daily tasks.
first i run
cp /var/spool/mail/<username> newmail.file
then I run