twzBackupFtp is a PHP script that creates a full site backup for a cPanel account, and sends it to an FTP server. It uses a text file (twzBackupFtp.ini) to determine the details of the account(s) to backup, and where to send them. There are also two optional scripts: twzBackupFtp_result checks whether a backup was successful, and twzBackupFtp_delete regularly removes older backups from the FTP server.

One installation of twzBackupFtp can be used to backup any number of accounts, sending them to multiple FTP servers. This is particularly useful for hosting resellers, or anyone with multiple web hosting accounts.

Here is a sample ini file for backing up two cPanel accounts:

hoursok    = 23,0,1,2,3,4,5,6
emailftp   =
emailerr   =
emailrep   =
userrep    = gsmith
emailfrom  =

domain     =
password   = ar$5tde#eed
skin       = x3
interval   = 1 week
nextbackup = 1 Nov 2011 04:00
ftpto      = server1

domain     =
password   = vErySEcr3t
skin       = x3
interval   = 2 days
nextbackup = 15 Nov 2011 02:20
ftpto      = server1

ftpuser =
ftppass = Cw3$wwsa2
ftphost =

In the _config section you define general settings for all backups, including the email address(es) to send backup reports.

The _ftp_XXX section stores credentials for an FTP server; if you have multiple FTP servers there will be more than one of these sections.

The other sections are the options for each cPanel account to be backed up. In the above example, the cPanel account with username "asm2b" will be backed up every week, and the data sent to an FTP server at The account with username "gsmith" will be backed up every 2 days, and sent to the same FTP server. Backups will only be performed between the hours of 11pm and 7am, and results will be emailed to A full summary report will be emailed to every time the "gsmith" backup is run.

twzBackupFtp is normally scheduled to run regularly, and only backs up one account each time. It then rewrites the ini file to extend that account's "nextbackup" date/time.








File date: 


Write a comment

  • Required fields are marked with *.