-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathbackup.php
More file actions
49 lines (44 loc) · 1.09 KB
/
Copy pathbackup.php
File metadata and controls
49 lines (44 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
/*
cPanel Backup Script
https://github.com/Xeroday/cPanel-Auto-Backup
*/
$auth = base64_encode("username:password");
$domain = "https://example.com:2083";
$theme = "paper_lantern";
$ftp = false;
$ftp_server = "";
$ftp_username = "";
$ftp_password = "";
$ftp_port = "21";
$ftp_directory = "/";
// Do not change below
$url = $domain . "/frontend/" . $theme . "/backup/dofullbackup.html";
$data = array();
if ($ftp) {
$data["dest"] = "ftp";
$data["server"] = $ftp_server;
$data["user"] = $ftp_username;
$data["pass"] = $ftp_password;
$data["port"] = $ftp_port;
$data["rdir"] = $ftp_directory;
}
$options = array(
'http' => array(
'header' => "Content-type: application/x-www-form-urlencoded\r\nAuthorization: Basic $auth\r\n",
'method' => 'POST',
'content' => http_build_query($data)
),
'ssl' => array(
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true
)
);
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);
if ($result === FALSE) {
exit("Error backing up server.");
}
echo $result;
?>