Re: Is there a script to compress mailboxes and touch new?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On May 28, 2004 12:08 am, Jake Johnson wrote:
> Hello,
> My Mail boxes are getting quite large and I was wondering if anyone had a
> script to append and gzip the files and touch new ones? --
> Jake Johnson
> http://www.plutoid.com


Jake,

Sounds like a fairly simple exercise if you just want to archive them without 
worrying about access to recent mail. If you want to read into the files and 
zip whats older than a certain date, that is a bit more work.

I beleive sendmail will just create any files needed so all you need to do is 
stop sendmail and any pop/imap servers, then zip the dir and store it 
somewhere (or each file), remove the existing files, restart the services.

As far as a script, you need to know what services might be accessing the 
mailbox files. If it is only sendmail:

#!/bin/bash
MAIL_DIR="/var/spool/mail"
DATE=` date +%y-%m-%d`
/sbin/service sendmail stop
tar zcf /archives/mailboxes_$DATE $MAIL_DIR
rm -f $MAIL_DIR/*
/sbin/service sendmail start
# each critical step should be checked for success before moving on.

This is totally untested.

Hope that points you in the right direction.
-- 
Pete Nesbitt, rhce


-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list

[Index of Archives]     [CentOS]     [Kernel Development]     [PAM]     [Fedora Users]     [Red Hat Development]     [Big List of Linux Books]     [Linux Admin]     [Gimp]     [Asterisk PBX]     [Yosemite News]     [Red Hat Crash Utility]


  Powered by Linux