forked from ianneub/php_backup_s3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbackup.dist.php
39 lines (28 loc) · 1.51 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
<?php
// AWS access info
define('awsAccessKey', '');
define('awsSecretKey', '');
define('awsBucket', '');
define('debug',false);
ini_set('date.timezone', 'America/Los_Angeles');
//Pass these options to mysqldump
define('mysqlDumpOptions', '--quote-names --quick --add-drop-table --add-locks --allow-keywords --disable-keys --extended-insert --single-transaction --create-options --comments --net_buffer_length=16384');
define('schedule','daily'); // Will this script run weekly, daily, or hourly?
require_once('include/backup.inc.php');
/*
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');
?>