Results 1 to 2 of 2
Hybrid View
-
31st May 2010, 07:43 PM #1OPMemberWebsite's:
wuploadlinks.net fileserve-movies.net fsdown.orgHelp 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(false, true, 'gzip', $name, time());
break;
case 'sqlite':
$extractor = new sqlite_extractor(false, true, 'gzip', $name, time());
break;
case 'postgres':
$extractor = new postgres_extractor(false, true, 'gzip', $name, time());
break;
case 'oracle':
$extractor = new oracle_extractor(false, true, 'gzip', $name, time());
break;
case 'mssql':
case 'mssql_odbc':
$extractor = new mssql_extractor(false, true, 'gzip', $name, time());
break;
case 'firebird':
$extractor = new firebird_extractor(false, true, 'gzip', $name, time());
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
-
2nd Jun 2010, 07:50 PM #2Member
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")
?>
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($ch, CURLOPT_URL, 'ftp://username:password@ftp.hotfile.com/'.$localfile);
curl_setopt($ch, CURLOPT_UPLOAD, 1);
curl_setopt($ch, CURLOPT_INFILE, $fp);
curl_setopt($ch, CURLOPT_INFILESIZE, filesize($localfile));
curl_exec ($ch);
curl_close ($ch);
Don't know if it's useful, am just trying to help you out
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
CodeGuard - Go back to any version of your website (auto backup)
By Jesse in forum Useful SitesReplies: 4Last Post: 27th Apr 2012, 12:15 PM -
CrownCloud - Backup solution - Backup your sites today ! For $5/Month
By speedbus in forum Other Hosting OffersReplies: 0Last Post: 17th Apr 2012, 06:55 AM -
Unable to restore backup using Wp complete backup
By Jayzzy in forum Webmaster DiscussionReplies: 13Last Post: 25th Mar 2012, 03:32 PM -
[Shared] Europe Hosting $1/month - Unlimited Features, auto-backup
By magic1000 in forum ArchiveReplies: 0Last Post: 29th Sep 2010, 03:10 AM -
Auto Backup Lite - Question!
By Mr.KiLLeR in forum vBulletinReplies: 3Last Post: 20th Jan 2010, 09:17 PM
themaLeecher - leech and manage...
Version 5.02 released. Open older version (or...