Emailing backup file

The bash script I wrote worked well, stepping through and backing up the 9 individual databases to a temporary directory, then archiving that directory. Unfortunately, the desired next step of emailing that file turned out to be an issue. The version of mail on the host company’s computer did not handle attachments and building the mime headers and converting the file to 7-bit seemed like a pain, so I thought I would do a little Python scripting. Unfortunately, the story there was the same — the appropriate python email modules weren’t there either.

However, php came to the rescue. I happened upon a php program, Backup2Email (http://www.backup2mail.com/) that did just what I wanted, but for a single database. My task was simply to add an array of databases plus the code to iterate through it, backing up indivually to a temp directory, then compressing that.

Leave a comment

Your email address will not be published.