Activity Stream
48,167 MEMBERS
6833 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Results 1 to 2 of 2

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1.     
    #1
    Member
    Website's:
    wuploadlinks.net fileserve-movies.net fsdown.org

    Default Help with auto backup

    I have this script that makes an auto backup of the database, but it will just save it in the server...

    Can anyone modify it so that it uploads it to rapidshare or w/e, o reven better to email me the back up?

    PHP Code: 
    <?php
    /**
    *
    * @package Auto Database Backup
    * @copyright (c) 2008 EXreaction
    * @license http://opensource.org/licenses/gpl-license.php GNU Public License
    *
    */

    if (!defined('IN_PHPBB'))
    {
        
    // Stuff required to work with phpBB3
        
    define('IN_PHPBB'true);
        
    $phpbb_root_path './';
        
    $phpEx substr(strrchr(__FILE__'.'), 1);
        include(
    $phpbb_root_path 'common.' $phpEx);

        
    // Start session management
        
    $user->session_begin();
        
    $auth->acl($user->data);
        
    $user->setup('acp/database');

        if (!
    backup_db())
        {
            
    trigger_error('The database has already been backed up today.');
        }

        
    trigger_error('BACKUP_SUCCESS');
    }

    function 
    backup_db()
    {
        global 
    $db$phpbb_root_path$phpEx$table_prefix;

        
    $name 'auto_backup/db_backup_' date('Y-m-d');

        
    //Make sure this script can only be ran once per day
        
    if (file_exists($phpbb_root_path 'store/' $name '.sql.gz'))
        {
            return 
    false;
        }

        include(
    $phpbb_root_path 'includes/functions_install.' $phpEx);
        include(
    $phpbb_root_path 'includes/acp/acp_database.' $phpEx);

        @
    set_time_limit(1200);
        @
    set_time_limit(0);

        switch (
    $db->sql_layer)
        {
            case 
    'mysqli':
            case 
    'mysql4':
            case 
    'mysql':
                
    $extractor = new mysql_extractor(falsetrue'gzip'$nametime());
            break;

            case 
    'sqlite':
                
    $extractor = new sqlite_extractor(falsetrue'gzip'$nametime());
            break;

            case 
    'postgres':
                
    $extractor = new postgres_extractor(falsetrue'gzip'$nametime());
            break;

            case 
    'oracle':
                
    $extractor = new oracle_extractor(falsetrue'gzip'$nametime());
            break;

            case 
    'mssql':
            case 
    'mssql_odbc':
                
    $extractor = new mssql_extractor(falsetrue'gzip'$nametime());
            break;

            case 
    'firebird':
                
    $extractor = new firebird_extractor(falsetrue'gzip'$nametime());
            break;
        }

        
    $extractor->write_start($table_prefix);

        foreach (
    get_tables($db) as $table_name)
        {
            
    // Get the table structure
            
    $extractor->write_table($table_name);

            
    // Data
            
    $extractor->write_data($table_name);
        }

        
    $extractor->write_end();

        
    add_log('admin''LOG_DB_BACKUP');

        
    set_config('backup_last_gc'time(), true);

        return 
    true;
    }

    ?>
    Gempis Reviewed by Gempis on . Help with auto backup I have this script that makes an auto backup of the database, but it will just save it in the server... Can anyone modify it so that it uploads it to rapidshare or w/e, o reven better to email me the back up? <?php /** * * @package Auto Database Backup * @copyright (c) 2008 EXreaction * @license http://opensource.org/licenses/gpl-license.php GNU Public License Rating: 5

    Please click the image above!

  2.   Sponsored Links

  3.     
    #2
    Member
    if your host has not disabled exec command and have perl then my post is useful

    upload rsapiresume.pl in the directory where the backup file is found

    PHP Code: 
    <?php 
    echo exec("perl rsapi.pl backup.tgz col Username password")
    ?>
    you'll get the link into rsapiuploads.txt
    change col to prem if you got a premium RS acc

    ~~~~~

    using cUrl to upload to HF by

    PHP Code: 
    $ch curl_init();
    $localfile 'backup.tgz';
    $fp fopen($localfile'r');
    curl_setopt($chCURLOPT_URL'ftp://username:password@ftp.hotfile.com/'.$localfile);
    curl_setopt($chCURLOPT_UPLOAD1);
    curl_setopt($chCURLOPT_INFILE$fp);
    curl_setopt($chCURLOPT_INFILESIZEfilesize($localfile));
    curl_exec ($ch);
    curl_close ($ch); 

    Don't know if it's useful, am just trying to help you out

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 4
    Last Post: 27th Apr 2012, 12:15 PM
  2. Replies: 0
    Last Post: 17th Apr 2012, 06:55 AM
  3. Unable to restore backup using Wp complete backup
    By Jayzzy in forum Webmaster Discussion
    Replies: 13
    Last Post: 25th Mar 2012, 03:32 PM
  4. [Shared] Europe Hosting $1/month - Unlimited Features, auto-backup
    By magic1000 in forum Archive
    Replies: 0
    Last Post: 29th Sep 2010, 03:10 AM
  5. Auto Backup Lite - Question!
    By Mr.KiLLeR in forum vBulletin
    Replies: 3
    Last Post: 20th Jan 2010, 09:17 PM

Tags for this Thread

BE SOCIAL