LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-28-2019, 08:41 PM   #1
lucmove
Member
 
Registered: Aug 2005
Location: Brazil
Distribution: Debian Stretch
Posts: 964

Rep: Reputation: 81
Best way to backup email?


I want to archive almost all of my email to an external disk. The idea is to free up space. I thought I could just move ~/Mail to external and start with a new, empty directory until I realized I will want to do incremental backups in the future and I have no idea how to do that. I also need to be able to search text in archived messages. Filtering by subject, sender or recipient would be nice. Automatic extraction of attachments even better. Is there such a marvel?
 
Old 07-28-2019, 08:44 PM   #2
scasey
Senior Member
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.6
Posts: 4,006

Rep: Reputation: 1370Reputation: 1370Reputation: 1370Reputation: 1370Reputation: 1370Reputation: 1370Reputation: 1370Reputation: 1370Reputation: 1370Reputation: 1370
How do you read your email now?
Are you running your own mail server? If not, are you accessing with POP3 or IMAP?
What Linux distro are you using?
 
Old 07-28-2019, 08:53 PM   #3
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 15,553
Blog Entries: 25

Rep: Reputation: 4511Reputation: 4511Reputation: 4511Reputation: 4511Reputation: 4511Reputation: 4511Reputation: 4511Reputation: 4511Reputation: 4511Reputation: 4511Reputation: 4511
I would use rsync with the "-a" argument and point it to the mail store.

Code:
rsync -a /path/to/mailstore /path/to/backup
See man rsync for an explanation of the -a (archive) argument.

Last edited by frankbell; 07-28-2019 at 08:54 PM.
 
Old 07-28-2019, 09:05 PM   #4
lucmove
Member
 
Registered: Aug 2005
Location: Brazil
Distribution: Debian Stretch
Posts: 964

Original Poster
Rep: Reputation: 81
Quote:
Originally Posted by scasey View Post
How do you read your email now?
Are you running your own mail server? If not, are you accessing with POP3 or IMAP?
What Linux distro are you using?
I download messages from both POP3 and IMAP accounts. I read them with a regular desktop MUA.
Running Debian.

Quote:
Originally Posted by frankbell View Post
I would use rsync with the "-a" argument and point it to the mail store.
That would keep the individual messages, but they're all MH. I understand MH has indexes. Can I just add or yank messages from the directories willy-nilly? Won't indexes get corrupt?

Also, how to search and read messages in the archive?
 
Old 07-28-2019, 09:16 PM   #5
scasey
Senior Member
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.6
Posts: 4,006

Rep: Reputation: 1370Reputation: 1370Reputation: 1370Reputation: 1370Reputation: 1370Reputation: 1370Reputation: 1370Reputation: 1370Reputation: 1370Reputation: 1370
Quote:
Originally Posted by lucmove View Post
I download messages from both POP3 and IMAP accounts. I read them with a regular desktop MUA.
Running Debian.
Which desktop MUA? Thunderbird has a built-in archiving function, for example, that has all the features you're asking about.

With an IMAP account, the email is only copied to your local desktop (you probably know that) while POP3 can be configured to "leave message on the server" So, archiving the IMAP accounts would have to be done on the server.

rsync -a (or check out rsnapshot, which uses rsync) will copy whatever is there, including the indices. If you copy everything, then you should be able to just point your MUA to the backup to search, etc...again, which MUA are you using?
 
Old 07-28-2019, 09:25 PM   #6
lucmove
Member
 
Registered: Aug 2005
Location: Brazil
Distribution: Debian Stretch
Posts: 964

Original Poster
Rep: Reputation: 81
Forget my MUA. I want an MUA-agnostic solution.

Now, including the indices is not good. If I copy them over, I will be overwriting indices for directories that contain thousands of messages with indices for directories that contain maybe a hundred. They will not match.
 
Old 07-28-2019, 09:44 PM   #7
lucmove
Member
 
Registered: Aug 2005
Location: Brazil
Distribution: Debian Stretch
Posts: 964

Original Poster
Rep: Reputation: 81
Quote:
Originally Posted by scasey View Post
Thunderbird has a built-in archiving function, for example, that has all the features you're asking about.
Thunderbird will take up 160MB upon installation. I need to save space, not spend more.
 
Old 07-29-2019, 02:13 AM   #8
Michael Uplawski
Member
 
Registered: Dec 2015
Location: Normandy, France
Distribution: Debian “testing” with very little “unstable”
Posts: 804
Blog Entries: 25

Rep: Reputation: 507Reputation: 507Reputation: 507Reputation: 507Reputation: 507Reputation: 507
Quote:
Originally Posted by lucmove View Post
Now, including the indices is not good. If I copy them over, I will be overwriting indices for directories that contain thousands of messages with indices for directories that contain maybe a hundred. They will not match.
You have to modify each index in the process, or not archive indices at all.

How about creating PDFs from your mail and store the attachments in the PDF? Incremental backups should work alright with that.

Edit: Archiving is one reason for me to use maildir.
 
Old 07-29-2019, 12:48 PM   #9
scasey
Senior Member
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.6
Posts: 4,006

Rep: Reputation: 1370Reputation: 1370Reputation: 1370Reputation: 1370Reputation: 1370Reputation: 1370Reputation: 1370Reputation: 1370Reputation: 1370Reputation: 1370
Your thread title says "backup email," but you ask about archiving email in the body of your OP.

Those are two entirely different things.
Backups are copies of emails as they existed at a point in time. They won't save space...in fact they will consume more space, albeit on an external drive.

Archives are very much dependent upon the type of account and, for local space, the MUA being used, as that's what manages the local storage environment. There's no correlation between the way email is stored/managed on the mail server(s) and the way the local MUA manages it. Put "email archiving" into your favorite search engine.
Every link will address how to do it for a specific provider or a specfic MUA.

If you want a generic solution, export all your local email to a common format [PDF was already suggested, you could also use .eml -- if your MUA supports it] and then delete it...
 
  


Reply

Tags
backup, email


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
Remote Backup script needed | backup every 1-2 seconds (Online/Hot backup) reda Linux - Newbie 4 04-20-2019 06:02 PM
[SOLVED] Backup, shrink backup and modify MBR of backup jps1x2 Linux - General 1 12-17-2013 06:03 AM
What is the best backup method to make a backup of a running Ubuntu server ? pmorin Linux - Software 9 09-28-2011 08:12 AM
Using rsync to backup data. Best way to backup folders? Micro420 Linux - General 2 11-23-2006 02:13 AM
Backup Server - my way or your way? vaworx Linux - General 4 11-30-2004 04:00 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:46 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