LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 07-12-2013, 06:59 AM   #1
plisken
Member
 
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.

Code:
/var/spool/mail/user {
monthly
rotate 12
create
missingok
postrotate
/etc/rc.d/rc.sendmail restart
endscript
}
 
Old 07-12-2013, 08:33 AM   #2
zhjim
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, 11:24 AM   #3
plisken
Member
 
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, 11:28 AM   #4
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 2,575

Rep: Reputation: 938Reputation: 938Reputation: 938Reputation: 938Reputation: 938Reputation: 938Reputation: 938Reputation: 938
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.
 
  


Reply


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 04:40 AM
How to archive mail? essdeeay Linux - General 1 03-25-2006 06:48 AM
recovering mail archive under kmail jjge Linux - Software 2 11-04-2005 01:39 PM
Mail Archive xedios Linux - Software 1 06-22-2005 04:18 PM
Mount/Unmount Network Drive Before/After Logrotate Archive GMcFall Linux - General 0 03-31-2004 04:15 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 07:26 PM.

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