GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Description: Small collection of scripts to manage wordpress
Homepage: http://people.warp.es/~koke/wordpress-scripts/
Clone URL: git://github.com/koke/wordpress-scripts.git
koke (author)
Tue May 27 01:23:25 -0700 2008
commit  e7336e4da8659986ebf2713654bdff9ff229d087
tree    ec592e10c44e21072bce35b0f42f81c5b5ab5800
parent  797b5556a5789719ea9f49578a039249249d5076
wordpress-scripts / wp-dump
100755 28 lines (21 sloc) 0.501 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
#!/usr/bin/env php
<?php
 
 
if ($argc != 3) {
  printf("Usage: %s wp-dir outfile\n", $argv[0]);
  die;
}
 
$wp_path = $argv[1];
$backup_name = $argv[2];
$wp_dir = basename($wp_path);
 
if (!is_dir($wp_path)) {
  printf("Invalid dir\n");
  die;
}
 
require $wp_path."/wp-config.php";
 
echo "Backing up database...\n";
if (DB_PASSWORD == "") {
    $popt = "";
} else {
    $popt = "-p" . DB_PASSWORD;
}
system(sprintf("mysqldump -h %s -u %s $popt %s | gzip -c9 > $backup_name", DB_HOST, DB_USER, DB_NAME));