LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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, 05:59 AM   #1
plisken
Member
 
Registered: Dec 2001
Location: Scotland
Distribution: Slackware 9.1-15 RH 6.2/7, RHEL 6.5 SuSE 8.2/11.1, Debian 10.5
Posts: 516

Rep: Reputation: 32
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, 07: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, 10:24 AM   #3
plisken
Member
 
Registered: Dec 2001
Location: Scotland
Distribution: Slackware 9.1-15 RH 6.2/7, RHEL 6.5 SuSE 8.2/11.1, Debian 10.5
Posts: 516

Original Poster
Rep: Reputation: 32
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
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,475

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
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



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

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

All times are GMT -5. The time now is 01:18 AM.

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
Open Source Consulting | Domain Registration