Previous Thread
Next Thread
Print Thread
Rate Thread
[7.3.x] Scheduled board close for backup #317296
06/26/2008 4:01 AM
06/26/2008 4:01 AM
Joined: Feb 2007
Posts: 329
The Netherlands
B
blaaskaak Offline OP
Yarp™
blaaskaak  Offline OP
Yarp™
B

Joined: Feb 2007
Posts: 329
The Netherlands
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:
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.


[Linked Image]
Sponsored Links
Re: [7.3.x] Scheduled board close for backup [Re: blaaskaak] #317297
06/26/2008 9:10 AM
06/26/2008 9:10 AM
Joined: Nov 2003
Posts: 482
SoCal
S
sirdude Offline
Enthusiast
sirdude  Offline
Enthusiast
S

Joined: Nov 2003
Posts: 482
SoCal
'repeat this for every other language file you have' ??

i assume you mean for each distinct language, modify generic.php.. no?

:shrug:

Re: [7.3.x] Scheduled board close for backup [Re: sirdude] #317298
06/26/2008 9:25 AM
06/26/2008 9:25 AM
Joined: Feb 2007
Posts: 329
The Netherlands
B
blaaskaak Offline OP
Yarp™
blaaskaak  Offline OP
Yarp™
B

Joined: Feb 2007
Posts: 329
The Netherlands
Originally Posted by sirdude
i assume you mean for each distinct language, modify generic.php.. no?


Yeppers smile


[Linked Image]
Re: [7.3.x] Scheduled board close for backup [Re: blaaskaak] #317335
06/30/2008 12:51 PM
06/30/2008 12:51 PM
Joined: Mar 2000
Posts: 21,084
Texas
AllenAyres Offline
I type Like navaho
AllenAyres  Offline
I type Like navaho

Joined: Mar 2000
Posts: 21,084
Texas
Thanks Yarp!


- Allen wavey
- What Drives You?
Re: [7.3.x] Scheduled board close for backup [Re: blaaskaak] #322928
01/15/2018 10:35 AM
01/15/2018 10:35 AM
Joined: Nov 2003
Posts: 329
UK
M
Mark_S Offline

Beta Tester
Mark_S  Offline

Beta Tester
M

Joined: Nov 2003
Posts: 329
UK
This continues to work in version 7.6.1 + patch so version 7.6.1.1


BOOM 7.6.+ rocks....
Sponsored Links

Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with, and recommend, the following Web Hosts:
· Stable Host
· Blue Host
· Interserver.net
Visit us on Facebook
Member Spotlight
Gizmo
Gizmo
Portland, OR, USA
Posts: 5,779
Joined: January 2000
Show All Member Profiles 
Forum Statistics
Forums64
Topics37,482
Posts293,586
Members13,811
Most Online1,498
Mar 17th, 2017
Top Posters(All Time)
AllenAyres 21,084
JoshPet 10,370
LK 7,395
Lord Dexter 6,709
Gizmo 5,779
Greg Hard 4,625
Top Posters(30 Days)
driv 19
isaac 17
Gizmo 6
Today's Statistics
Currently Online 908
Topics Created 0
Posts Made 0
Users Online 2
Birthdays 19
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2019 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 7.7.2
(Snapshot build 20190304.dev)
PHP: 5.4.45 Page Time: 0.040s Queries: 15 (0.012s) Memory: 3.2091 MB (Peak: 3.4181 MB) Data Comp: Zlib Server Time: 2019-03-20 10:03:46 UTC