[ILUG] Script to move Maildir content

Niall O Broin niall at linux.ie
Tue Jul 7 12:38:36 IST 2009


On 7 Jul 2009, at 12:25, Patrick O'Connor wrote:

> Thanks for all the responses, it looks like I'll be building a bash  
> script
> alright. I have the bulk of the mails backed up onto the new machine  
> so
> won't need to be doing a big transfer across the network. Any mails  
> since
> the backup will be brought across by modifying the script to only  
> include
> mails from a certain date.

This is exactly why you use rsync - no need to mess with find, just  
run rsync again and it will only copy what's new.  HOWEVER, know what  
you're doing, and look at the --dryrun option. By default, rsync  
decides that files have changed based on their size and modification  
time, and if you didn't do the initial copy with rsync, you mightn't  
have preserved those attributes.

> I'll delve into the manuals for find and cpio to see what I can come  
> up
> with.

Repeat after me - rsync, rsync, rsync.



Niall



More information about the ILUG mailing list