Backup All Wordpress Databases On a Server
This simple script looks in a specified directory (and its subdirectories), the webserver document root preferably, for wp-config.php files. When it finds a file it parses it to extract the variables DB_NAME, DB_USER, DB_PASSWORD and DB_HOST inside the file and then connects to the database and dump it using mysqldump into a text file compressed using gzip. All the backups are placed in another user specified diretory where they are suffixed with the current date in %Y-%m-%d format.
Some of the advantages are that you don’t need to specify anything on beforehand since it will automatically find all the Wordpress installations in the document root and back up their databases. Also, if a user or administrator changes the settings then the script will use the new values since it does not save them anywhere, it reads them straight from the configuration file on every run.
It should probably be extended with some error handling but right now it’s simple and works fine.
July 9th, 2006 at 10:08 am
Presumably it wouldn’t be too hard to get it to drop into subdirectories by one level to look for the files? All the wordpress installs on jedimoose.org are in their own subdirectories, but if it can drop a level, then this would be an excellent tool for us.
September 13th, 2006 at 9:15 pm
I probably wasn’t clear enough, it does a recursive check of course, hence, it’d find everything in your whole directory structure.
April 12th, 2007 at 7:17 pm
[…] script is a php port of the bash script by Niklas Lindblad with error handling, and database connection pre-tests, it also has very good logging for easy […]
May 16th, 2007 at 10:18 am
Fantastic script. Obviously a believer in KISS Engineering! Thanks for sharing!
June 9th, 2007 at 4:17 pm
bondage novels…
Value source for bondage novels….
June 9th, 2007 at 6:36 pm
free gay newsletters…
Title of free gay newsletters…
June 9th, 2007 at 11:23 pm
bdsm term serving…
Relevant links for bdsm term serving….