| Revision 1012,
549 bytes
checked in by strat.cristian@…, 3 years ago
(diff) |
|
Basic backup scripts.
|
-
Property svn:eol-style set to
native
-
Property svn:executable set to
*
|
| Line | |
|---|
| 1 | #! /usr/bin/env php |
|---|
| 2 | <?php |
|---|
| 3 | |
|---|
| 4 | require_once(dirname($argv[0]) . "/utilities.php"); |
|---|
| 5 | |
|---|
| 6 | // This is a really dumb script that calls to mysqldump. |
|---|
| 7 | // Uses auth stuff from config.php. |
|---|
| 8 | // FIXME: password visible in ps list. How retarded. |
|---|
| 9 | |
|---|
| 10 | if (isset($argv[1])) { |
|---|
| 11 | $backup_file = $argv[1]; |
|---|
| 12 | } else { |
|---|
| 13 | $backup_file = IA_ROOT_DIR . "backup.sql.gz"; |
|---|
| 14 | } |
|---|
| 15 | |
|---|
| 16 | $cmd = sprintf("mysqldump --user=%s --password=%s --host=%s %s" |
|---|
| 17 | ." | gzip > %s", |
|---|
| 18 | IA_DB_USER, IA_DB_PASS, IA_DB_HOST, IA_DB_NAME, $backup_file); |
|---|
| 19 | |
|---|
| 20 | log_print("Running '$cmd'"); |
|---|
| 21 | system($cmd); |
|---|
| 22 | |
|---|
| 23 | ?> |
|---|
Note: See
TracBrowser
for help on using the repository browser.