|
||||||
| Forums FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| ARCHIVES - Programming & Scripting A place to discuss website design, programming, shell scripts, etc |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Hi
I'm looking for a bash shell, php or perl script to backup all /home/username/Maildir directories (and there content) within the /home/ directory to another folder location such as /backup/username/Maildir. This will enable me to backup emails within my postfix mail server environment. I've already got an idea of what the program should do and I'm assuming to somebody in the know that it would be easy. -It needs read the contents of the /home dir to find all the directories that contain a Maildir directory -then somehow stick all these into an array or something -then in a loop feed in all the values and run a cp command on top level directory (/home/username) and then a cp on the Maildir directory (and all its contents). Obviously this would have to contain the mkdir command to generate the new folders in the location its backing up to. -And when all are copied, come out of the loop and end the script I've never really done any scripting and don't have a scooby doo where to start but with my basic knowledge of programming, I have a rough idea of what is needed. So if anybody could point me in the direction of some good resources, get me started or even better, just write it for me - that would be absolutely fantastic! Seriously though, any help would be much appreciated. Thanks |
|
|||
|
All user accounts have only one top Maildir directory which would be something like /home/somebody/Maildir or /home/somebody/Mail, depending on how you have set up your SMTP and IMAP servers.
So all you need to do is something like this: cd /home tar cf - */Maildir | (cd /backup/home; tar xf -) and lots of other possibilities. |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|