This is a python backup script on server side. Which script archive all files newer than last backup into a tar.gz file, and send this file to assigned email address. This script is a simple but effective solution for virtual host files backup. It records all versions of modified files, but remembers no delete operation. When we need specific version of a file, we can find related tar.gz file and decompress it to get the needed files.

I use this script to backup files on Lunarpages' virtual host.

Chinese document for this script can be access at MailDiffBackup

On this page... (hide)

  1.   1.  Requirement
  2.   2.  Download
  3.   3.  User guide
  4.   4.  Known problems

1.  Requirement

  • Python 2.3 or higher

2.  Download

Version 0.1: Attach:MyProject/MailDiffBackup_0.1.zip

3.  User guide

 python MailDiffBackup.py -s DirectoryToBeBackup -t TemporaryDirctory  -p PrefixForBackupFile -m MailAddress

Make use of Cron service, we can execute this script periodically. On Lunarpages, we can set

 15 3 * * * python /home/soongs0/MailDiffBackup.py -s /home/soongs0/public_html/elias -t /home/soongs0/tmp -p elias.cn -m MyMail@MailServer.com
And then at 3:15 everyday, the backup script will be executed and it will send the incremental backup file to MyMail@MailServer.com

4.  Known problems

This script has not ensure the incremental backup file is smaller than mail server's attach file size limitation. If the incremental backup file is too large sometime, then I suggest to reduce the backup interval, so the incremental backup file will become smaller.

GlossyBlue theme adapted by David Gilbert
Powered by PmWiki