Patrick,
> 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.
Seems more-and-more like "the script" is a once-off, and will be tweaked
on-the-fly "as needed". In which case no stress-testing,
bullet-proofing, error-checking, etc, applies, and in which case the
most economical set of commands should be adopted - as suggested by the
others here.
At the other end of the scale, say in a "production" environment, a
"script" would need to be much more robust, and might be perhaps 10-20
times bigger and more complex. For a simple example, with your intended
list of Old/New usernames, the spec and script would need to address:
- The old-name/new-name pairings are duplicated.
- The old-name is duplicated - with different new-names
- The new-name is duplicated (with different old-names)
- The old-name has no matching folders/files.
- There's data for an old-name, but that name is not in the list
- Any old-name or new-name contains odd-ball leading/trailing/embedded
characters - / \ , : spaces, accented-vowels, umlauts, etc, etc. (Eg, if
you're running on an "English" system, and "foreign" chars are embedded
in names of users/folders/files, that can be VERY interesting!!
So, it could end up as a 20-line "script", as one usually sees in
scripting books, tutorials, etc. With no error-checking, permissions
checks, disk-space checks, etc, etc, etc.....
Or a 500-line one!!
Best regards,
- Mike
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!