I need a simple script in PHP that will do this:
1: Go through each mysql database on a server
2: Make a backup of the database and all its tables with the name bakN_dbName - where N is a number 1 to 3 depending on which rotation and dbName is the original database name
The backups should be rotated each time the script is run; just a simple fashion, i.e. bak1, bak2, bak3 and then overwrite bak1 again. A simple text file should contain a log of the backup processes in reverse order with timestamps with high level info.
The databases are running and changing constantly, so I want the backup process to be done by MySQL using SELECT & INSERTS rather than simply copying the db files.
All data must be preserved, i.e. watch out for timestamp fields etc.
Database structures change, so bakN files will need to be created each time the script is run.
Table & colum names should be preserved.
If a server contains the databases:
then after running the script once there will be databases of:
All connection data should be in variables.
The database backup may not necessarily be on the same host, so use independent connections for source / destination.
There's a nifty table copy script as part of php_myadmin which seems to do the job perfectly for copying tables, that might save some time.
If there's a simpler way than above, let me know... :) My goal is to have full rotational backups running every X hours to complement more robust daily system backups.
1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done.
2) Installation package that will install the software (in ready-to-run condition) on the platform(s) specified in this bid request.
3) Exclusive and complete copyrights to all work purchased. (No GPL, 3rd party components, etc. unless all copyright ramifications are explained AND AGREED TO by the buyer on the site).