LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Sendmail unread mails backup (https://www.linuxquestions.org/questions/linux-server-73/sendmail-unread-mails-backup-720613/)

mride 04-21-2009 05:00 AM

Sendmail unread mails backup
 
Hi,
when i run cron job for every day in my server. am getting mails locally,
after long time its showing like 50 mails or 100 mails while am using mail command.

How to backup all unread mails and how to clear without mail lose.

Please help on this

Thanks
Manoj

******* 04-21-2009 10:24 AM

I do not understand the "unread mail" part, but if you mean those emails actually are unfinished processes then running the lsof command on each (child?) process Id might show where the input data resides. If it is for instance in a temporary file still held open you could save the file, else I wouldn't know.

XavierP 04-24-2009 03:35 PM

Moved: This thread is more suitable in Linux-Server and has been moved accordingly to help your thread/question get the exposure it deserves.

Suncoast 04-24-2009 09:32 PM

Want a quick and dirty method?

Assume username is fred

cd /var/spool/mail
mv fred fred_arc
(As soon as a new message comes in, it will recreate a new mailbox.)
tar -czvf /home/fred/fred_arc_mail.tgz ./fred_arc
(After confirming the tar and compression succeeded)
rm fred_arc


If you need to restore, just extract it, then cat it back into the original mailbox file.

mride 04-24-2009 11:17 PM

am clear now
thankyou


All times are GMT -5. The time now is 03:00 PM.