Admin

AdminAdmin is verified member.

Well-Known Member
Staff member
Administrator
Code này cho phép bạn backup tất cả thông tin trên cpanel rồi gửi file backup dưới dạng file đính kèm tới email của bạn
PHP:
 // ********* Cai dat thong so *********
// Info required for cPanel access
$cpuser = "username"; // Username used to login to CPanel
$cppass = "password"; // Password used to login to CPanel
$domain = "ten mien"; // Domain name where CPanel is run
$
skin = "x"; //script ko hoat dong neu ko dung skin.Neu su dung host cua wmvn thi la x3// Info required for FTP host
$ftpuser = "ftpusername"; // Username for FTP account
$ftppass = "ftppassword"; // Password for FTP account
$ftphost = "ftp.Ten mien"; // Full hostname or IP address for FTP host
$ftpmode = "ftp"; // FTP mode ("ftp" for active, "passiveftp" for passive)
// Notification information
$notifyemail = "email cua ban"; // 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;
// **********Khong chinh sua cai dat duoi day.Script edit by choideptb.*********
if ($secure) {
$url = "ssl://".$domain;
$port = 2083;
} else {
$url = $domain;
$port = 2082;
}
$socket = fsockopen($url,$port);
if (!$socket) { echo "Failed to open socket connectionaE| Bailing out!\n"; exit; }
// Encode authentication string
$authstr = $cpuser.":".$cppass;
$pass = base64_encode($authstr);
$params = "dest=$ftpmode&email=$notifyemail&server=$ftphost&user=$ftpuser&pass=$
Bạn sửa rồi lưu code trên thành 1 file fullbackup.php rồi up
lên host ngang hàng với thư mục public_html, public_ftp....
Vào cpanel của bạn->Cron Job ->
Advanced(unix style)
Ổ đây bạn nhập email (file backup sẽ đính kèm tới email này)
Ngày tháng backup
Nhập đường dẫn tới file fullbackup.php
Code:
/usr/local/bin/php/home/ten_tai_khoan_cpanel/fullbackup.php
Thiết lập xong click vào [commit change]
Cái này chưa thử trên cpanel, vistapanel
Code by choideptb WMTVN
 

Facebook Comments

Similar threads

Admin
Replies
1
Views
1K
namday
N
Admin
Replies
0
Views
2K
AdminAdmin is verified member.
Admin
Admin
Replies
14
Views
5K
C
Admin
Replies
1
Views
1K
congtust24
congtust24
Admin
Replies
4
Views
2K
AdminAdmin is verified member.
Admin
Back
Top