Skip to content

Instantly share code, notes, and snippets.

View JShipps's full-sized avatar

Jason Shipps JShipps

View GitHub Profile
@JShipps
JShipps / fullbackup.php
Created May 31, 2017 04:12
cPanel Full Backup Script
<?php
$cpaneluser = 'user'; // cPanel username
$cpaneluserpass = 'pass'; // cPanel password
$theme = 'paper_lantern'; // Must match current selected cPanel theme ('paper_lantern' in the majority of cases, 'x3' is possible as well)
$ftp = true; // If it's false the backup will be stored in user's home directory, otherwise it will be uploaded via FTP to some custom location
$ftpserver = 'serverX.web-hosting.com'; // Must be localhost for current server or custom hostname for remote FTP upload
$ftpusername = 'user'; // cPanel/SFTP username. Should be the same as cPanel username for local upload or custom for remote upload
$ftppassword = 'pass'; // cPanel/SFTP password. Should be the same as cPanel password for local upload or custom for remote upload
$ftpport = '21098'; // SFTP port. Should be 21 in most cases.
$ftpdirectory = '/home/user/backups'; // Directory on FTP server to store backups. MUST EXIST BEFORE BACKUP OR BACKUP PROCESS WILL FAIL