POOR ENGLISH:
This script automatically generates a copy .sql of the data base every 5 minutes, while worked in Admin. Without interrupting the current work. Easy to install and to personalize.
INSTALL:
1.- Copy auto_backup_db.php in /admin/inludes/
2.- In "admin/includes/application_top.php" before the last line (?>) write the following line:
require(DIR_WS_INCLUDES.'/auto_backup_db.php');
When the best is possible, the good is not sufficient.
ESPAŅOL:
Este script realiza automaticamente copias de la base de datos en un archivo .sql, mientras se esta trabajando en el Administrador y sin interrumpir lo que se este realizando en ese momento. Es facil de isntalar y de personalizar.
INSTALACION:
1. Copiar el archivo auto_backup_db.php en "/admin/includes/".
2. En "admin/includes/application_top.php", antes del final (?>) agregar la siguiente linea:
require(DIR_WS_INCLUDES.'/auto_backup_db.php');
Cuando lo mejor es posible, lo bueno no es suficiente.
GOC66
Made in Argentina
Legend: 
Download

Report
This is written for osC 2.2 with PHP 5 and has been tested on PHP 4 & 5, SQL 4 & 5, osC 2.2 ms2 & rc1 plus is register_globals compatible so should work with most versions.
This contribution automatically backs up your database at regular intervals whilst you are logged into admin.
It will create an archive backup at a longer intervals, you set the intervals in admin.
It can also zip or gzip the backups, if required, also set in admin.
Having gained access to a server with PHP 4 I`ve finally been able to remove last remaining bug with php 4, it was a little documented variation in a timeing function.
Backups by Database Backup Manager are read properly these will now be ignored unless they are the only files in the backup directory.
Forum at http://forums.oscommerce.com/index.php?showtopic=303380
Full Package
This is written for osC 2.2 with PHP 5, but should work with most versions.
Modified code again to hopefuly remove last remaining bugs with php 4.
Altered Backup File reads so backups by Database Backup Manager are read properly these will now be ignored unless they are the only files in the backup directory.
If only non-auto backups exist, their file name will be read & an attempt to work out file date made, this may not be accurate depending on the file names.
Added table list to file, useful if you have Database Backup Manager.
Added timer.
Forum at http://forums.oscommerce.com/index.php?showtopic=303380
Full Package
This is written for osC 2.2 with PHP 5, but should work with most versions.
Modified code to hopefuly remove last remaining bugs with php 4.
Altered Backup File reads so backups by Database Backup Manager are read properly.
Modified install for non-session admin logins.
Config options has moved its own group with auto setup function, if you have a older install the autosetup will move existing configs to new location.
Full Package
Changed the name of gzip function as caused error with Database backup manager contrib.
Moved config options to its own group and created auto setup function, if you have a older install the autosetup will move existing configs to new location.
Modified code to improve compatibility with older php versions.
Gzip thanks to Jan Zonjee for the gzip function, its unchanged from his contibution Database backup manager apart from function name.
there is also a zip option if you have it & pear librarys available on your server.
Forum at http://forums.oscommerce.com/index.php?showtopic=303380
Full Package
Auto Backup Install V2.4
Added gzip thanks to Jan Zonjee for the gzip function, its unchanged from his contribution Database backup manager.
Full Package
Auto Backup Install 2.3a
Minor update to correct error with old php versions.
Added zip function
Started Forum at http://forums.oscommerce.com/index.php?showtopic=303380
If your site does'nt have the zip function ask your host to install it.
Other contribs use 'system' etc functions, these may be disabled on some servers for security, therefore I`ve used PEAR. Pear is included with PHP, however you will probably need to ask your host to install the 'archive_zip' PEAR extension: I`ve added an option in admin to turn on or off the zipp function, I`ve also written it so the function will only be called if it exists, so if its not there you will get an error, but it wont be fatal.
If you cant get the pear zip library installed, use version 2.2 of this contrib.
Backup only occurs with registered admin for security.
If a old backup less than maximum age does`nt exist, last backup is kept.
IE with 'Backup Save Interval' set to 12Hrs a archived backup is created every 12Hrs.
Full Package
Added zip function
Started Forum at http://forums.oscommerce.com/index.php?showtopic=303380
If your site does'nt have the zip function ask your host to install it.
Other contribs use 'system' etc functions, these may be disabled on some servers for security, therefore I`ve used PEAR. Pear is included with PHP, however you will probably need to ask your host to install the 'archive_zip' PEAR extension: I`ve added an option in admin to turn on or off the zipp function, I`ve also written it so the function will only be called if it exists, so if its not there you will get an error, but it wont be fatal.
If you cant get the pear zip library installed, use version 2.2 of this contrib.
Backup only occurs with registered admin for security.
If a old backup less than maximum age does`nt exist, last backup is kept.
IE with 'Backup Save Interval' set to 12Hrs a archived backup is created every 12Hrs.
Full Package
Made some further improvements:
Altered install so backup only occurs with registered admin for security.
Re-coded so if a old backup less than maximum age does`nt exist, last backup is kept.
IE with 'Backup Save Interval' set to 12Hrs a archived backup is created every 12Hrs.
The settings occur in Module Options, if you can`t set these on your site, install Total Configuration http://addons.oscommerce.com/info/5040 , its a quick, easy install.
Full Package
I`ve made some corrections to supremecenterhosting update, unfortunatly he did'nt realise the automatic function relies on the date appended to the file, so by setting that to Y only, he made the interval 1 year!
I`ve made the following changes:
Reinstated time stamp, but without seconds as not needed.
Added an SQL so you can set interval in admin (In Module Options).
Added option to delete old backup up to a maximum age, I recommend setting this to 12 hours, if you set it too long you will always delete old backup.
Made messages more informative.
Spotted error in delete function, corrected that & time calcs..
Full Package
I`ve made some corrections to supremecenterhosting update, unfortunatly he did'nt realise the automatic function relies on the date appended to the file, so by setting that to Y
only, he made the interval 1 year!
I`ve made the following changes:
Reinstated time stamp, but without seconds as not needed.
Added an SQL so you can set interval in admin (In Module Options).
Added option to delete old backup up to a maximum age, I recommend setting this to 12 hours, if you set it too long you will always delete old backup.
Made messages more informative.
Full Package
I wanted the backup to overwrite the existing backup so I made an easy modification by changing YmdHis to just Y. I also changed the hypen to an underscore so the file name is now something like
db_database_name_2008.sql
- Traduction de la contrib en FR
- Insertion de la personnalisation Temps dans le readme
- Restructuration de tout le fichier
Very Good Job.
I just added some english translations. AUthor takes full credit.
ADD ON:
To change the minutes of each backup, you have to change the following line:
if($at_dif_date>'500') {
$at_backup_db = 'at_backupnow';
define('SUCCESS_DATABASE_SAVING', 'ATENCION: Se está guardando la Base de Datos ( '.$at_dif_date.' - '.$at_ref_entry.' ).');
}
into this:
if($at_dif_date>'1000000') {
$at_backup_db = 'at_backupnow';
define('SUCCESS_DATABASE_SAVING', 'ATENCION: Se está guardando la Base de Datos ( '.$at_dif_date.' - '.$at_ref_entry.' ).');
}
This will make a backup of your database every day.
It is very easy to change it to 2 days or even just 2 hours.
If you have any further questions, just contact me on my email or AIM screenname.
POOR ENGLISH:
This script automatically generates a copy .sql of the data base every 5 minutes, while worked in Admin. Without interrupting the current work. Easy to install and to personalize.
INSTALL:
1.- Copy auto_backup_db.php in /admin/inludes/
2.- In "admin/includes/application_top.php" before the last line (?>) write the following line:
require(DIR_WS_INCLUDES.'/auto_backup_db.php');
When the best is possible, the good is not sufficient.
ESPAŅOL:
Este script realiza automaticamente copias de la base de datos en un archivo .sql, mientras se esta trabajando en el Administrador y sin interrumpir lo que se este realizando en ese momento. Es facil de isntalar y de personalizar.
INSTALACION:
1. Copiar el archivo auto_backup_db.php en "/admin/includes/".
2. En "admin/includes/application_top.php", antes del final (?>) agregar la siguiente linea:
require(DIR_WS_INCLUDES.'/auto_backup_db.php');
Cuando lo mejor es posible, lo bueno no es suficiente.
GOC66
Made in Argentina