[Dovecot] backup dovecot
What is correct way to backup dovecot store? Is am I right what is just enough to copy all maildir and my configuration. So in case failure I can just prepare new machine copy config, maildirs and I'm good to go with this.
On Thu, 22 Nov 2007 20:40:24 +0300 Nikolay Shopik shopik@inblock.ru wrote:
What is correct way to backup dovecot store? Is am I right what is just enough to copy all maildir and my configuration. So in case failure I can just prepare new machine copy config, maildirs and I'm good to go with this.
I think that you should use a cheap machine with a disk drive as big as the mail server's (or use squashfs) and imapsync every night... that way people will be able to access their mail the next second that the big server fails. Look at http://freshmeat.net/projects/imapsync
It's just an idea... not the best way to do it I guess...
On Fri, Nov 23, 2007 at 12:53:50PM +0200, Bazy wrote:
On Thu, 22 Nov 2007 20:40:24 +0300 Nikolay Shopik shopik@inblock.ru wrote:
What is correct way to backup dovecot store? Is am I right what is just enough to copy all maildir and my configuration. So in case failure I can just prepare new machine copy config, maildirs and I'm good to go with this.
I think that you should use a cheap machine with a disk drive as big as the mail server's (or use squashfs) and imapsync every night... that way people will be able to access their mail the next second that the big server fails. Look at http://freshmeat.net/projects/imapsync
It's just an idea... not the best way to do it I guess...
A normal rsync to another server of the maildir and configs will work fine. If you need to backup using windows or mac then a samba share is the best bet.
Mark
On 23.11.2007 13:59, Mark Adams wrote:
On Fri, Nov 23, 2007 at 12:53:50PM +0200, Bazy wrote:
On Thu, 22 Nov 2007 20:40:24 +0300 Nikolay Shopik shopik@inblock.ru wrote:
What is correct way to backup dovecot store? Is am I right what is just enough to copy all maildir and my configuration. So in case failure I can just prepare new machine copy config, maildirs and I'm good to go with this.
I think that you should use a cheap machine with a disk drive as big as the mail server's (or use squashfs) and imapsync every night... that way people will be able to access their mail the next second that the big server fails. Look at http://freshmeat.net/projects/imapsync
It's just an idea... not the best way to do it I guess...
A normal rsync to another server of the maildir and configs will work fine. If you need to backup using windows or mac then a samba share is the best bet.
Mark
Links how to use rsync will be appreciated.
A normal rsync to another server of the maildir and configs will work fine. If you need to backup using windows or mac then a samba share is the best bet.
Mark
Links how to use rsync will be appreciated.
see
http://samba.anu.edu.au/rsync/
its very to use. I recommend you use this for ANY file migration between linux machines (or solaris), mail or otherwise. read up about it at the page.. a nice little outline is here
http://www.fredshack.com/docs/rsync.html
An example of syncing 2 directories over ssh, keeping all permissions intact. This command run on the source maildir server.
rsync -av -e"ssh" /source_maildirs/ username@hostname:/destination/maildirs/
Mark.
On Fri, 23 Nov 2007, Mark Adams wrote:
A normal rsync to another server of the maildir and configs will work fine. If you need to backup using windows or mac then a samba share is the best bet.
Mark
Links how to use rsync will be appreciated.
[...]
An example of syncing 2 directories over ssh, keeping all permissions intact. This command run on the source maildir server.
rsync -av -e"ssh" /source_maildirs/ username@hostname:/destination/maildirs/
Couple tips (not criticisms): Nowadays, ssh is the default (unless compiled otherwise). So, the '-e"ssh"' is likely unneccessary. As is the 'username@' part, if the username is the same.
And something to watch out for as a new rsync user:
The trailing slash is important on the source path. From the rsync 'man' page (read it!): A trailing slash on the source changes this behavior to avoid creating an additional directory level at the destination. (But, it doesn't do anything on the destination path.)
That'd shorten the command to:
rsync -av /source_maildirs/ hostname:/destination/maildirs
Best, Ben
On 24.11.2007 0:14, Benjamin R. Haskell wrote:
On Fri, 23 Nov 2007, Mark Adams wrote:
A normal rsync to another server of the maildir and configs will work fine. If you need to backup using windows or mac then a samba share is the best bet.
Mark
Links how to use rsync will be appreciated.
[...]
An example of syncing 2 directories over ssh, keeping all permissions intact. This command run on the source maildir server.
rsync -av -e"ssh" /source_maildirs/ username@hostname:/destination/maildirs/
Couple tips (not criticisms): Nowadays, ssh is the default (unless compiled otherwise). So, the '-e"ssh"' is likely unneccessary. As is the 'username@' part, if the username is the same.
And something to watch out for as a new rsync user:
The trailing slash is important on the source path. From the rsync 'man' page (read it!): A trailing slash on the source changes this behavior to avoid creating an additional directory level at the destination. (But, it doesn't do anything on the destination path.)
That'd shorten the command to:
rsync -av /source_maildirs/ hostname:/destination/maildirs
Best, Ben Benjamin,
Thanks for tips and now command line looks more admin-friendly ;)
Benjamin R Haskell dovecot@benizi.com writes:
[...]
An example of syncing 2 directories over ssh, keeping all permissions intact. This command run on the source maildir server.
rsync -av -e"ssh" /source_maildirs/ username@hostname:/destination/maildirs/
Couple tips (not criticisms): Nowadays, ssh is the default (unless compiled otherwise). So, the '-e"ssh"' is likely unneccessary. As is the 'username@' part, if the username is the same.
... Or if it's different, but one took care to provide an entry
in ~/.ssh/config, like:
$ cat ~/.ssh/config ...
Host alias remote.host HostName remote.host User remote.user
... $
And something to watch out for as a new rsync user:
The trailing slash is important on the source path. From the rsync 'man' page (read it!): A trailing slash on the source changes this behavior to avoid creating an additional directory level at the destination.
To put it short, SRC-DIR refers to a directory, and SRC-DIR/ --
to its contents.
> (But, it doesn't do anything on the destination path.)
That'd shorten the command to:
rsync -av /source_maildirs/ hostname:/destination/maildirs
On Mon, 26 Nov 2007, Ivan Shmakov wrote:
Benjamin R Haskell dovecot@benizi.com writes:
[...]
And something to watch out for as a new rsync user:
The trailing slash is important on the source path. From the rsync 'man' page (read it!): A trailing slash on the source changes this behavior to avoid creating an additional directory level at the destination.
To put it short, SRC-DIR refers to a directory, and SRC-DIR/ -- to its contents.
That always seemed like an odd way to put it. Saying "its contents" implies (or at least leads me to suspect) that SRC-DIR/ would be synonymous with SRC-DIR/* But, it's not. The former updates the permissions/attributes on DEST-DIR, but the latter doesn't.
Illustration by example, (now that we're way off topic) :-)
$ mkdir foo
$ cd foo
$ umask 077
$ mkdir -p sa/sb
$ echo foo > sa/sb/sc
$ chmod 770 sa
$ mkdir with-slash without-slash with-star
$ rsync -av sa without-slash
$ rsync -av sa/ with-slash
$ rsync -av sa/* with-star
$ tree -p -L 2
.
|-- [drwxrwx---] sa
| -- [drwx------] sb |-- [drwxrwx---] with-slash |
-- [drwx------] sb
|-- [drwx------] with-star
| -- [drwx------] sb
-- [drwx------] without-slash
`-- [drwxrwx---] sa
The important bits: No 'sa' directory in with-slash or with-star. Permissions on with-slash are the same as 'sa', but with-star doesn't match.
Best, Ben
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Fri, Nov 23, 2007 at 04:14:10PM -0500, Benjamin R. Haskell wrote:
[...]
That'd shorten the command to:
rsync -av /source_maildirs/ hostname:/destination/maildirs
I'd add a z option for good measure (compress) -- at least if you consider your CPUs to be faster than your net.
(that would be "rsync -avz ...")
Enjoy
- -- tomás -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux)
iD8DBQFHflfXBcgs9XrR2kYRAp8TAJ4j2Mk//ahf/qgeWBESxejjH1JamwCfZBrK vVHnFG59R42xAAUyT3tCur4= =QjnQ -----END PGP SIGNATURE-----
On Fri, 23 Nov 2007, Nikolay Shopik wrote:
Links how to use rsync will be appreciated.
Others have posted how to do a single backup using rsync. I will mention here a program I use called dirvish which lets you easily do incremental backups at only a fractionally-increased storage cost over a single backup.
It's quite nice and gives me warm fuzzy feelings. I believe http://dirvish.org/ will point you the right way.
-- Asheesh.
-- He's just a politician trying to save both his faces...
On 23.11.2007 13:53, Bazy wrote:
On Thu, 22 Nov 2007 20:40:24 +0300 Nikolay Shopik shopik@inblock.ru wrote:
What is correct way to backup dovecot store? Is am I right what is just enough to copy all maildir and my configuration. So in case failure I can just prepare new machine copy config, maildirs and I'm good to go with this.
I think that you should use a cheap machine with a disk drive as big as the mail server's (or use squashfs) and imapsync every night... that way people will be able to access their mail the next second that the big server fails. Look at http://freshmeat.net/projects/imapsync
It's just an idea... not the best way to do it I guess...
I know about imapsync cuz I'm already done migration using it ;).
participants (7)
-
Asheesh Laroia
-
Bazy
-
Benjamin R. Haskell
-
Ivan Shmakov
-
Mark Adams
-
Nikolay Shopik
-
tomas@tuxteam.de