Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 07-12-2013, 05:59 AM   #1
Registered: Dec 2001
Location: Scotland
Distribution: Slackware 9.1/13.37/14 RedHat 6.2/7/EL6.5 SuSE 8.2/11.1
Posts: 471

Rep: Reputation: 30
Archive mail question. To use Logrotate or not

As per subject, I'm looking to archive/retain some users mail, as I currently do, albeit manually.

I was thinking of adding something like this to my logroate.conf file, is this the done thing or is there perhaps another way of doing it.

/var/spool/mail/user {
rotate 12
/etc/rc.d/rc.sendmail restart
Old 07-12-2013, 07:33 AM   #2
Senior Member
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,748
Blog Entries: 11

Rep: Reputation: 233Reputation: 233Reputation: 233
Dunno if you actually have to restart sendmail after moving the file. Would need a test for this if sendmail opens the files when new mail get in or if it holds the file descriptor. I doubt that it holds the fd cause for a big system that would be a lot of handles.

I guess I would not use logrotate for this. Also something to evaluate. For sure use the olddir option for sendmail so the mails go into a special directory and are "out of the way".
Old 07-12-2013, 10:24 AM   #3
Registered: Dec 2001
Location: Scotland
Distribution: Slackware 9.1/13.37/14 RedHat 6.2/7/EL6.5 SuSE 8.2/11.1
Posts: 471

Original Poster
Rep: Reputation: 30
Probably right about not needing to restart it after move as I don't after I manually rename and on first mail, it creates the new file.

logrotate was just the first thing that I thought off, wondering if there was a more common way in use.
Old 07-12-2013, 10:28 AM   #4
Senior Member
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 2,716

Rep: Reputation: 1035Reputation: 1035Reputation: 1035Reputation: 1035Reputation: 1035Reputation: 1035Reputation: 1035Reputation: 1035
You could look at dirvish, that way only the mails that "change" / "are new" are copied but it maintains symlinks so that each month would look and act like a "full" backup.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Synonym mail Archive and Disclaimer geharvey Linux - Software 0 06-13-2007 03:40 AM
How to archive mail? essdeeay Linux - General 1 03-25-2006 05:48 AM
recovering mail archive under kmail jjge Linux - Software 2 11-04-2005 12:39 PM
Mail Archive xedios Linux - Software 1 06-22-2005 03:18 PM
Mount/Unmount Network Drive Before/After Logrotate Archive GMcFall Linux - General 0 03-31-2004 03:15 PM > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:22 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration