klenwell information services : CategoryLampback


LampBack is a PHP class I've developed to create simple automated backup scripts for LAMP-based websites. It makes a system call to mysqldump to back up mysql databases to a file which can then be sent to a designated email address. By configuring a crontab to run LampBack, you can create simple regular backup of your remotely hosted mysql databases.

LampBack is hosted at the google code site


google code repository
test scripts


    // create object
    $LampBack = new LampBack($debug=1);
    // settings
    $LampBack->mysqldump_path = '/usr/local/bin/mysqldump';     // default setting
    $LampBack->db_user = 'USER';
    $LampBack->db_pass = 'PASS';
    $LampBack->mail_to = 'user@example.com';
    $LampBack->mail_from = 'lampback-mailer';
    $LampBack->tar_on = 1;
    $LampBack->mail_on = 1;
    $LampBack->save_files = 0;

    // database (add as many as you want)
    $LampBack->DATABASE['DB_NAME'] = '*';

    // back up
    if ( $num_dbs_backed = $LampBack->export() )
        $LampBack->print_d("LampBack complete -- $num_dbs_backed databases backed up", 'green');
        $LampBack->print_d('LampBack export failed');

Similar Projects

PHP Script Backups Databases and Files (tvlgiao.com)