[7.3.x] Scheduled board close for backup - 06/26/2008 11:01 AM
I have a cronjob running that backup's my ubb database and directory. Since it's better to have the board closed while making a backup, I have added a scheduled close for ubb.
open /languages/english/generic.php
Find:
Add below:
Repeat editing the generic.php for every other language you have.
open /ubbthreads.php
Find:
Add below:
Save, upload, and voila! Board is closed between 04:30 and 04:45.
Adjusting $backupstarttime and $backupstoptime will adjust the times the board will automaticly close.
It will also close the board for admins. The purpose of the close is to make the best database snapshop possible, so you don't want yourself messing around the forum also.
How to backup your forum? Lost of information about the subject on ubbcentral.
open /languages/english/generic.php
Find:
PHP Code
$ubbt_lang['COPY2CLIP'] = 'Copy';
Add below:
PHP Code
$ubbt_lang['BACKUPCLOSED'] = 'Because of a scheduled backup the board is closed from %s until %s';
Repeat editing the generic.php for every other language you have.
open /ubbthreads.php
Find:
PHP Code
$user['USER_STYLE'] = $force ? 0 : $user['USER_STYLE'];
$html->set_style($force);
Add below:
PHP Code
// closed for backup?
$backupstarttime = "04:30";
$backupstoptime = "04:45";
$backuptime = date("H:i");
if ($backuptime >= $backupstarttime && $backuptime < $backupstoptime) {
$insert = $ubbt_lang['BACKUPCLOSED'];
$closed = true;
$fatal_error = true;
$fatal_error_message = sprintf($insert,$backupstarttime,$backupstoptime);
}
// end closed for backup
Save, upload, and voila! Board is closed between 04:30 and 04:45.
Adjusting $backupstarttime and $backupstoptime will adjust the times the board will automaticly close.
It will also close the board for admins. The purpose of the close is to make the best database snapshop possible, so you don't want yourself messing around the forum also.
How to backup your forum? Lost of information about the subject on ubbcentral.