This repository has been archived by the owner on Dec 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathbackup.dist.php
47 lines (32 loc) · 1.49 KB
/
backup.dist.php
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
<?php
/*
The following must be configured before running the script.
*/
define('awsAccessKey', ''); // required
define('awsSecretKey', ''); // required
define('awsBucket', ''); // required
// Will this script run "weekly", "daily", or "hourly"?
define('schedule','daily'); // required
require_once('include/backup.inc.php');
// You may place any number of .php files in the backups folder. They will be executed here.
foreach (glob(dirname(__FILE__) . "/backups/*.php") as $filename)
{
include $filename;
}
/*
backupDBs - hostname, username, password, prefix, [post backup query]
hostname = hostname of your MySQL server
username = username to access your MySQL server (make sure the user has SELECT privliges)
password = your password
prefix = backup filenames will contain this prefix, this prevents overwriting other backups when you have more than one server backing up at once.
post backup query = Optional: Any SQL statement you want to execute after the backups are completed. For example: PURGE BINARY LOGS BEFORE NOW() - INTERVAL 14 DAY;
*/
backupDBs('localhost','username','password','my-database-backup','');
/*
backupFiles - array of paths, [prefix]
array of paths = An array of one or more file paths that you want backed up
prefix = Optional: backup filenames will contain this prefix, this prevents overwriting other backups when you have more than one server backing up at once.
*/
backupFiles(array('/home/myuser', '/etc'),'me');
backupFiles(array('/var/www'),'web files');
?>