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: 330
The Netherlands
B
blaaskaak Offline OP
Yarp™
blaaskaak  Offline OP
Yarp™
B

Joined: Feb 2007
Posts: 330
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: 491
SoCal
S
sirdude Offline
Enthusiast
sirdude  Offline
Enthusiast
S

Joined: Nov 2003
Posts: 491
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: 330
The Netherlands
B
blaaskaak Offline OP
Yarp™
blaaskaak  Offline OP
Yarp™
B

Joined: Feb 2007
Posts: 330
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: 25,587
Texas
AllenAyres Offline
I type Like navaho
AllenAyres  Offline
I type Like navaho

Joined: Mar 2000
Posts: 25,587
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: 331
UK
M
Mark_S Offline

Beta Tester
Mark_S  Offline

Beta Tester
M

Joined: Nov 2003
Posts: 331
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
Pilgrim
Pilgrim
NH, USA
Posts: 345
Joined: June 2000
Show All Member Profiles 
Forum Statistics
Forums64
Topics37,456
Posts293,497
Members13,800
Most Online1,498
Mar 17th, 2017
Top Posters(All Time)
AllenAyres 25,587
JoshPet 11,330
Rick 8,373
LK 7,396
Lord Dexter 6,503
Gizmo 5,941
Greg Hard 5,533
Top Posters(30 Days)
isaac 8
Gizmo 3
driv 1
Today's Statistics
Currently Online 960
Topics Created 0
Posts Made 0
Users Online 0
Birthdays 26
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2018 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 7.6.3
(Snapshot build 20180925.dev)
PHP: 5.4.45 DB: MySQLi Page Time: 0.032s Queries: 15 (0.010s) Memory: 3.2684 MB (Peak: 3.6700 MB) Zlib enabled. Server Time: 2018-09-26 11:26:34 UTC