LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] Script to move Maildir content

[ILUG] Script to move Maildir content

Rory Browne rbmlist at gmail.com
Mon Jul 6 23:34:11 IST 2009


You might have trouble ssh-ing 60GB ( particularly if the servers
aren't beside each other ) , so it might be worth considering either
splitting the users up by first-letter-of-username, or creating a cpio
archive locally, and copy it to remote, and extract it in separate
steps. That way if one step fails, you only have to repeat that one
step. I'll talk more about that when I get some sleep in.

2009/7/6 Rory Browne <rbmlist at gmail.com>:
> I haven't read very deep into what you've said, but I'm going to take
> a leap of faith, and pretty much fundamentally disagree with everyone
> here ( except perhaps Paul Murray ).
>
> I don't think you should  bring this to a bash-specific group, unless
> you're already involved with such a group. I don't think you should
> write it in anything else ( except perhaps ksh, or perhaps tcl, but
> that would be only if you know them better than bash ).
>
> I would need to examine your problem a bit closer, but I think if you
> have a good look through the manuals for find and cpio, you will get
> yourself 90% of the way there.
>
>
> I think you're loking for something along the lines of
>
> [oldserver]$ find /location/of/old/maildirs/*/.maildir/{cur,.*}
> -exclude .Trash | cpio -o | ssh newserver 'cpio -i '
>
> I believe cpio has an option for string substitution that you could
> use to change /old/maildirs to /new/maildirs ( or you could just
> create a temporary symlink structure to simulate the old environment
> ). I'd need to check the man page for find - I don't think the exclude
> option is just -exclude ( if you can't find it, just use grep  ) as in
> ( find ... | grep -vf .Trash | cpio )
>



More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell