These days I needed a script to backup only a part of a customers website using a CRON. Most of the control panels I know allow only a complete website backup and this is not what I needed. While plaaning the script, I thought about a solution for webmaster without full SSH access to their hosting account. A typical situation could be:

  • A shared hosting account that allows only backups for the whole site incl. database, emails and other settings
  • No administration rights via SSH
  • A FTP host for the storage of the the backup files
  • Support for cURL and a default PHP5 configuration (sorry no more code for PHP4).

First of all we need to create a variable to define the local source directory on your website where you like to start the backup from: (more…)