وارد كنترل پنل هاست شويد و به file manager برويد و سپس به پوشه قبل public_html برويد در اين قسمت
يك فايل جديد با اسم backup.php بسازيد و روي edit كليك كنيد سپس محتويات زير را در آن قرار دهيد:
توضیحات:کد:// PHP script to allow periodic cPanel backups automatically, optionally to a remote FTP server. // This script contains passwords. KEEP ACCESS TO THIS FILE SECURE! (place it in your home dir, not /www/) // ********* THE FOLLOWING ITEMS NEED TO BE CONFIGURED ********* // Information required for cPanel access $cpuser = "username"; // Username used to login to cPanel $cppass = "password"; // Password used to login to cPanel $domain = "example.com"; // Your main domain name $skin = "x3"; // Set to cPanel skin you use (script will not work if it does not match). // Information required for FTP host $ftpuser = "username"; // Username for FTP account $ftppass = "password"; // Password for FTP account $ftphost = "host"; // IP address of your hosting account $ftpmode = "ftp"; // FTP mode ("ftp" for active, "passiveftp" for passive) $ftpport = "21"; // Port (default = 21) $rdir = "/"; // Remote dir (defaut = / ) // Notification information $notifyemail = "dzr323@gmail.com"; // Email address to send results // Secure or non-secure mode $secure = 0; // Set to 1 for SSL (requires SSL support), otherwise will use standard HTTP // Set to 1 to have web page result appear in your cron log $debug = 1; // *********** NO CONFIGURATION ITEMS BELOW THIS LINE ********* if ($secure) { $url = "ssl://".$domain; $port = 2083; } else { $url = $domain; $port = 2082; } $socket = fsockopen($url,$port); if (!$socket) { echo "Failed to open socket connection… Bailing out!\n"; exit; } // Encode authentication string $authstr = $cpuser.":".$cppass; $pass = base64_encode($authstr); $params = "dest=$ftpmode&email=$notifyemail&server=$ftphost&user=$ftpuser&pass=$ftppass&port=$ftpport&rdir=$rdir&submit=Generate Backup"; // Make POST to cPanel fputs($socket,"POST /frontend/".$skin."/backup/dofullbackup.html?".$params." HTTP/1.0\r\n"); fputs($socket,"Host: $domain\r\n"); fputs($socket,"Authorization: Basic $pass\r\n"); fputs($socket,"Connection: Close\r\n"); fputs($socket,"\r\n"); // Grab response even if we don't do anything with it. while (!feof($socket)) { $response = fgets($socket,4096); if ($debug) echo $response; } fclose($socket); ?>
در کد بالا مقدادیر مشخص شده را تغییر بدید به مشخصات هاست خودتون.
يوزر سي پنل هاست
$cpuser = "username"; // Username used to login to cPanel
رمز هاست
$cppass = "password"; // Password used to login to cPanel
آدرس دامين اصلي هاست
$domain = "example.com"; // Your main domain name
$skin = "x3"; // Set to cPanel skin you use (script will not work if it does not match).
// Information required for FTP host
يوزر اف تي پي
$ftpuser = "ftpusername"; // Username for FTP account
رمز
$ftppass = "ftppassword"; // Password for FTP account
آدرس آيپي
$ftphost = "ip_address"; // IP address of your hosting account
$ftpmode = "passiveftp"; // FTP mode
آدرس ايميل شما
// Notification information
$notifyemail = "any@example.com"; // Email address to send results
// Secure or non-secure mode
$secure = 0; // Set to 1 for SSL (requires SSL support), otherwise will use standard HTTP
// Set to 1 to have web page result appear in your cron log
$debug = 0;





پاسخ با نقل قول