Previous Thread
Next Thread
Print Thread
Rate Thread
[7.3.x] Scheduled board close for backup #317296
06/26/2008 3:01 AM
06/26/2008 3: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 8:10 AM
06/26/2008 8: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 8:25 AM
06/26/2008 8: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 11:51 AM
06/30/2008 11:51 AM
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 9:35 AM
01/15/2018 9: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
isaac
isaac
California
Posts: 1,208
Joined: July 2001
Show All Member Profiles 
Forum Statistics
Forums64
Topics37,467
Posts293,523
Members13,802
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,947
Greg Hard 5,533
Top Posters(30 Days)
isaac 1
Today's Statistics
Currently Online 870
Topics Created 2
Posts Made 2
Users Online 2
Birthdays 12
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2018 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 7.7.0
(Snapshot build 20181115.dev)
PHP: 5.4.45 Page Time: 0.031s Queries: 15 (0.009s) Memory: 3.1916 MB (Peak: 3.4062 MB) Data Comp: Zlib Server Time: 2018-12-13 10:53:26 UTC