View Full Version : [vbcron] Automatic database backup [v1.3]
This script will allow you to automaticly back-up your vBulletin database (or any database you have access to).
Current Stable Version: 1.3.1
System Requirements-
vBulletin RC 2 or later
Unix/Linux server with MySQL Dump support
Ability to chmod folders to 777 (775 works on some servers)
IMPORTANT NOTE TO ALL THAT USE THIS SCRIPT
This script invokes an outside process that runs in the backround on your server to backup and compress your database. It is important to remember that this is not an instant process, do not enter you ftp as soon as the script says it is done and try to download your backup. It will likely be incomplete and your server will probbly still be writting the file to disk.
I ussally give the process an hour or two before I mess with the file, larger databases will take more time of course.
Installing the script-
1. You will need to change the information here for it to work correctly on your server:
// ######################## Begin edits ######################
define('DB_HOST', 'localhost'); // database host
define('DB_USER', 'db_user'); // database username
define('DB_PASSWORD', 'password'); // database password
define('DB_NAME', 'db_name'); // vbulletins database name
define('DUMP_PATH', '/path/to/dump/folder'); // path to where db backup will be stored
define('DUMP_MAKE_TAR', 1); // set this to 1 for the backup to be compressed in a .tar.gz file
// ####################### End Edits ##########################
2. CHMOD the folder you specified in DUMP_PATH to 777
3. Upload the vbcron_db_backup_131.php file to the /vbroot/includes/cron directory
4. Enter you admin control panel, under Scheduled Tasks click Add New Scheduled Task
Enter the information has follows:
Title: Automatic Database Back-up
Day of the Week:
This is the day of the week the task should run on. Set this to * to have it not apply, or for it to run every day (if Day of the Month is set to * below). Otherwise select a specific day. Note that this will override the day of the month option, unless this is set to *.
Day of the Month:
Set this to the specific day of the month the task should run. This is overridden by the Day of the Week setting above. Set this to * to have it not apply.
Hour:
This is the hour of the day the task should run. Set it to * to have it run every hour.
Minute:
This is the minute of the hour the task should run. Set it to * to have it run every minute (not really recommended!).
Log Actions:
If this is set to Yes, every time the scheduled task runs, a log will be made indicating that the task was run, and in certain cases, additional information will be provided (e.g. for the Birthday Email task, the usernames who were sent birthday wishes will be noted).
Filename:
Enter the path to vbcron_db_backup_131.php, ./includes/cron/vbcron_db_backup_131.php should work in most cases
What was added in 1.3.1
- Fixed all bugs reported in 1.3
What was added in 1.3
- Added ability for script to leave logs
Improvments to come:
- Email alert when db is begin backed up
- Close board when back-up is in process
- 'Lock down' db durring backup so no one can access it
- Table, by table back-up
- Clear session table before backup
- Make script more windows friendly
- Delete last .sql (or .tar.gz) file when doing current back-up
- Ability to use hashed file names for back-ups
- Save back-up to forgin server
To come: version 2.0
2.0 will introduce most, if not all the fetures listed above.
Public beta testing will begin in the next few days, expect a stable version in at least 2 weeks time.
Boofo
03-04-2004, 05:50 AM
How do we find out if we have MySQLdump on our server?
Natch
03-04-2004, 06:38 AM
How do we find out if we have MySQLdump on our server?
You can connect via SSH/telnet and try a mysqldump command from the CLI ...
Natch
03-04-2004, 06:48 AM
Brad: you have a couple of Parse errors ... missing ";"'s in the DEFINE area ...
define('DB_HOST', 'localhost')
define('DB_USER', 'user')
Both need those pesky ;'s
EDIT: //
Also on the last line it should look like this
exec('mysqldump --add-drop-table -h ' .DB_HOST. ' -u' .DB_USER. ' -p' .DB_PASSWORD. ' ' .DB_NAME. ' 2>' .DUMP_PATH. '/error.txt >' .DUMP_PATH. '/' .DUMP_DATE. '.sql');
as you have a couple of extra bits you don't need ...
worked fine after that :) :)
Great idea!
Natch
03-04-2004, 06:58 AM
One suggestion as an improvement ...
Include the facility to make this script also tar.gz the resultant SQL dump file, for compactness ...
Pikok
03-04-2004, 10:06 AM
One suggestion as an improvement ...
Include the facility to make this script also tar.gz the resultant SQL dump file, for compactness ...
I think you should be able to do that with this..
// now execute the backup
exec('mysqldump --add-drop-table -h' .DB_HOST. ' -u' .DB_USER. ' -p' .DB_PASSWORD. ' ' .DB_NAME. ' 2>' .DUMP_PATH. '/' .DUMP_DATE. '-error.txt >' .DUMP_PATH. '/' .DUMP_DATE. '.sql');
// now archive and compress the backup
exec('tar -cSz --remove-files -C' .DUMP_PATH. ' -f' .DUMP_PATH. '/' .DUMP_DATE. '.tar.gz ' .DUMP_DATE. '.sql ' .DUMP_DATE. '-error.txt');
Natch
03-04-2004, 10:08 AM
Wheee - thanks :)
Natch sorry about that, I coded this real late :), ill fix the zip.
Pikok, ill add that to the file to, and probbly some more compresstion methods over time :)
er... sorry for double posting. Just wondering, what is the difference between --opt and --add-drop-table?
mOdEtWo
03-04-2004, 03:22 PM
This is a great hack, I'll install this one.
Also, good suggestion, Natch. I was on my way to request something like this. A sql file takes up lots of space when the forum is large (we have around 80,000 now), so making it a tar.gz is making the file compact and downloadable. ;)
Yay! Best hack so far!
EDIT: A suggestion. What about the script being able to disable the boards and display a "We're doing database maintenance, come back in 10 minutes" type of message? Is this possible?
Also, I get a Fatal error: Call to undefined function: query() in /var/www/vb3/includes/functions.php on line 501 error message once the script is done. What does it mean?
mharmon
03-04-2004, 03:24 PM
This worked great.. a few questions though -- Will it overwrite the old dump each day?
Also -- it also wrote an XXXXXXXX-error.txt file along with the dump but it's empty.
Fi_InCogNiTo
03-04-2004, 03:31 PM
Worked great on RC4. Also worked with the tar.gz
Thanks =D
mOdEtWo
03-04-2004, 03:48 PM
This worked great.. a few questions though -- Will it overwrite the old dump each day?
Also -- it also wrote an XXXXXXXX-error.txt file along with the dump but it's empty.
this file, and the sql file, is deleted once the tar.gz process is finished.
Ryan Ashbrook
03-04-2004, 06:36 PM
Exactly what I was looking for! Thank you!
Hey guys, im busy today (I just got done dumping a ton of trash with a tractor! LOL) but if I get time I may update this one today, if not tomorrow.
Planned improvements:
Zip file type support
Delete last backup when doing current one
Close boards when backing up
Clear session table before backup
Options to NOT include stuff like the postcache in the backup
ThePartyBorg
03-04-2004, 07:02 PM
Mmh, now this is helpfull, just question. Is it also possible to dumb the file on an other server. We don't really have to place to store backups on the webserver. So I collect them at my own server instead at the moment, would be a dream if all the handelings I need to do would be taken over by this script.
TPB:
I'll look into that for you, however the backup would then consume alot of bandwidth with the transfer to the new server :)
anabolicedge
03-04-2004, 07:23 PM
after uploading to the server, how does it run? How often will it backup? More info please, and thanks!
Natch
03-04-2004, 07:31 PM
after uploading to the server, how does it run? How often will it backup? More info please, and thanks!
You would need to set up a new "scheduled task" or cron job with the script as the action ... otherwise it's just a nice file that don't do much ...
anabolicedge
03-04-2004, 07:34 PM
can someone explain this please? Maybe a text file with some instructions for us that dont know how.
thanks
Mr. HillBilly
03-04-2004, 08:47 PM
Why not just have the script get the database info from config.php?
cteselle
03-04-2004, 08:59 PM
Great hack! *clicks install*
I modified it a tad to keep a "yesterday" and a "today". I'm sure your new version will incorporate something like this, I just couldn't wait. ;)
// move the current file so we can always keep 2 backups
print('mv ' .DUMP_PATH. '/' .DB_NAME. '-today.tar.gz ' .DUMP_PATH. '/' .DB_NAME. '-yesterday.tar.gz 2> /dev/null');
// now execute the backup
print('mysqldump --add-drop-table -h' .DB_HOST. ' -u' .DB_USER. ' -p' .DB_PASSWORD. ' ' .DB_NAME. ' 2>' .DUMP_PATH. '/' .DB_NAME. '-' .DUMP_DATE. '-error.txt >' .DUMP_PATH. '/' .DB_NAME. '-' .DUMP_DATE. '.sql');
if (DUMP_MAKE_TAR == '1')
{
// now archive and compress the backup
print('tar -cSz --remove-files -C' .DUMP_PATH. ' -f' .DUMP_PATH. '/' .DB_NAME. '-today.tar.gz ' .DB_NAME. '-' .DUMP_DATE. '.sql ' .DB_NAME. '-' .DUMP_DATE. '-error.txt');
}
kristian
03-05-2004, 09:44 AM
Well - this is just not working!!! I have configured it with my own details and have put it in the scheduled tasks list but when I do 'run now' no backup is run!!!
Does my server need to have 'Safe Mode' turned off by any chance? :ermm:
AlexanderT
03-05-2004, 09:57 AM
Hey guys, im busy today (I just got done dumping a ton of trash with a tractor! LOL) but if I get time I may update this one today, if not tomorrow.
Planned improvements:
Zip file type support
Delete last backup when doing current one
Close boards when backing up
Clear session table before backup
Options to NOT include stuff like the postcache in the backup
Wonderful!!!
Floris
03-05-2004, 10:34 AM
Why not just have the script get the database info from config.php?
exactly :)
ThePartyBorg
03-05-2004, 12:17 PM
TPB:
I'll look into that for you, however the backup would then consume alot of bandwidth with the transfer to the new server :)
Well, we don't really have a big database (about 8k posts), and have plenty of bandwidth already, so a few more wouldn't be a problem.
gmarik
03-05-2004, 04:17 PM
Sounds good. Where could I found more info about it?
Mr. HillBilly
03-05-2004, 07:25 PM
Question, Once it gets does it deletes the .sql file and leaves the tar.gz right?
I ran this my self from adminCP and my browser timed-out waiting for it to finish :|
Morpheus84
03-06-2004, 03:53 PM
At my vB3 the Script won't will be work :(
I click on "Do it now" and my vB says "All done."
On my FTP Server there's nothing to see about a backup :(
Plz help.
ceo_tfw
03-07-2004, 06:46 AM
installed it, great hack,,
makes life easier
is there a way to date the file as it does it,
i.e.: friday.sql... sat.sql.. sun.sql and so on
and overwrite the same file as it come to it i.e.: fri.sql will overwrite fri.sql
any thoughts on this
cteselle
03-07-2004, 05:04 PM
is there a way to date the file as it does it,
i.e.: friday.sql... sat.sql.. sun.sql and so on
and overwrite the same file as it come to it i.e.: fri.sql will overwrite fri.sql
any thoughts on this
You should be able to change this line:
$cur_date = date('U');
to this:
$cur_date = date('l');
I haven't tested it but it should do it.
ceo_tfw
03-07-2004, 05:23 PM
that did not work, it came up with 1.tar.gz
cteselle
03-07-2004, 05:35 PM
that did not work, it came up with 1.tar.gz
hmm... did you change it to a lower case L? It looks like a 1, but it should be a lower case L. I will test this out on my forums shortly.
ceo_tfw
03-07-2004, 06:11 PM
I will try l (lower case L)
it looks like the number one to me (1)
ceo_tfw
03-07-2004, 06:18 PM
I tryed it and it worked great, it created Sunday.sql
thanks for the help
cheers for that
mOdEtWo
03-08-2004, 09:20 AM
I ran this my self from adminCP and my browser timed-out waiting for it to finish :|
Hmm, that shouldn't matter. It should still run the mysql dump. It did at my forums...
Can't wait for the update Brad! :D
Boofo
03-08-2004, 10:13 AM
Question, Once it gets does it deletes the .sql file and leaves the tar.gz right?
I ran this my self from adminCP and my browser timed-out waiting for it to finish :| You need to chmod the directory for the backup to 777. It timed out on me too when I had it chmoded it to 775. ;)
Boofo
03-08-2004, 10:15 AM
How about the day of the week and the date behind it? Like this:
Sunday-Mar_3_2004.tz?
EDIT: I figured it out. This is what I have now:
$cur_date = date('l-F_j_Y');
and the filename is:
Monday-March_8_2004.tar.gz
Works like a charm, Brad! Thank you, sir. ;)
kristian
03-08-2004, 10:43 AM
Does my server need to run with 'Safe Mode' OFF for this to work?
Boofo
03-08-2004, 12:49 PM
Does my server need to run with 'Safe Mode' OFF for this to work?
It shouldn't make a difference. Do you have the backup directory chmoded to 777? And are you sure you have the correct path to the backup directory?
WildEye
03-08-2004, 07:32 PM
How about the day of the week and the date behind it? Like this:
Sunday-Mar_3_2004.tz?
EDIT: I figured it out. This is what I have now:
$cur_date = date('l-F_j_Y');
and the filename is:
Monday-March_8_2004.tar.gz
Works like a charm, Brad! Thank you, sir. ;)
Thanks alot to both of you. Just had to include the path to mysqldump, which I misstyped a couple of times (and forgot to include the '...
Very nice feature, which i'll see if works tomorrow morning after my scheduled backup at 6am :) (already tested the run now thing)
Mr. HillBilly
03-08-2004, 08:39 PM
What settings would I set to make the script run every 2 days in the admincp task area?
WildEye
03-09-2004, 07:35 AM
Small problem...
While the task ran as scheduled and made the file in the correct area, the time was half an hour late... and there is no record of the script being run in the log. (view all). I selected log entries: yes.
Any tips?
cteselle
03-09-2004, 03:24 PM
I was wondering about this as well... I looked at the other cron scripts and noticed a call to the log_cron_action function. I tried adding:
log_cron_action('Database Backup Completed', $nextitem);
to the end of the file, and the script stalled altogether. Anyone know why this function wouldn't work right? :ermm:
Pikok
03-12-2004, 06:20 AM
Small problem...
While the task ran as scheduled and made the file in the correct area, the time was half an hour late... and there is no record of the script being run in the log. (view all). I selected log entries: yes.
Any tips?
There has to be someone on your site at the time it's set to run or it won't run until the next time someone visits.. Also, only one script's run each time, even if more than one are waiting to be ran.
mOdEtWo
03-12-2004, 06:49 AM
Planned improvements:
Zip file type support
Delete last backup when doing current one
Close boards when backing up
Clear session table before backup
Options to NOT include stuff like the postcache in the backup
When? :)
Martyjp
03-14-2004, 12:33 PM
It shouldn't make a difference. Do you have the backup directory chmoded to 777? And are you sure you have the correct path to the backup directory?
What format for the path should we be using?
/home/space/public_html/backupdir or ./backupdir ?
*arie
03-14-2004, 12:39 PM
thanks, this worked for me! :p
btw, Martyjp , i used the 1st path you mentioned.
/home/space/public_html/backupdir
Morpheus84
03-14-2004, 01:36 PM
nobody could help me ? :(
MrZeropage
03-14-2004, 04:11 PM
I hope the "extended version" will be released soon, which switches the board offline for the backup-process - and of course turns it on again after finishing ;)
Christine
03-14-2004, 10:51 PM
ThePartyBorg,
I am also backing up to another server. Why not just write a system cron that will take the datadump from this vBcron and ftp it to the other box?
Brad.loo,
Nice job! One question -- would it be possible to exclude tables from this (search/word/etc) so as to pare down the size of the datadump?
Boofo
03-14-2004, 10:53 PM
What format for the path should we be using?
/home/space/public_html/backupdir or ./backupdir ?
/home/space/public_html/backupdir
lasto
03-14-2004, 11:28 PM
anychance of being able to actually reload the backup back though this proggie as i dont have a clue of how to telnet in and do it that way.
On vb2 someone made a hack that did just this it saved to a folder on the server and you could also re-install it if needed.If this was added this would be a cool hack esp for someone like me as this is one of the major reasons i wont update to vb3 cause my host wont allow outside connections so i cant use a program like MYSQLfront to do it all for me.
Plz consider it :)
Marulatree
03-15-2004, 01:37 PM
I'm getting this error:
Parse error: parse error in /home/******/public_html/forum/includes/cron/****.php on line 31
TCSoul
03-15-2004, 05:25 PM
At my vB3 the Script won't will be work :(
I click on "Do it now" and my vB says "All done."
On my FTP Server there's nothing to see about a backup :(
Plz help.
I'm actually experiencing the same problem as Morpheus, and I'm trying to diagnose it a little bit further. I'm thinking that the script is being found just fine, but it is exiting out of itself because of the first line of the script:
if ($DB_site = NULL)
{
exit;
}
Now then, I am already fairly certain this is a stupid question... BUT.... I sure don't see any variables called $DB_site anywhere in this file. Does it make sense that that would be the cause of the problem? I don't really think so, because everybody else can seem to get this working fine... That said, would this problem result from typing an improper path name in teh actual script. I'm confused because vb says it is 'All Done', but nothing is actually happening, nor is anythgin being registered in my Scheduled Tasks log....
mOdEtWo
03-16-2004, 06:17 AM
BUT.... I sure don't see any variables called $DB_site anywhere in this file. Does it make sense that that would be the cause of the problem? I don't really think so, because everybody else can seem to get this working fine...
Nah, it hasn't got anything to do with vB. It's using MySQLdump, a command to backup databases to files, and you specify the database name in the php script.
Anyway, Brad.loo, s'up? When can we expect an update with the new features? I think this is one of the best "hacks"/additions to vB3 so far. So keep up the good work! https://vborg.vbsupport.ru/external/2011/01/19.gif
Marulatree
03-16-2004, 11:46 AM
bump?
NTLDR
03-16-2004, 12:02 PM
if ($DB_site = NULL)
{
exit;
}
if ($DB_site == NULL)
{
exit;
}
That is what that section should be like.
I vote for the ability to move the backup to a different server too!
I would like to have the backups ftp'd to my home ftp-server, but i doubt i can set any system cron's on my hosting site.
Symbian.info
03-17-2004, 01:11 PM
This is a vbcron script that will backup your database to a .sql file on your server.
You need MySQLdump for this to work, also a folder chmoded to 775 (or 777).
You will need to change the information here for it to work correctly on your server:
// Set these vars up to to suit your server
define('DB_HOST', 'localhost'); // database host
define('DB_USER', 'user'); // database username
define('DB_PASSWORD', 'db_pass'); // database password
define('DB_NAME', 'vbulletin'); // vbulletins database name
define('DUMP_PATH', '/path/to/dump/folder'); // path to where db backup will be stored
define('DUMP_MAKE_TAR', 1); // set this to 1 for the backup to be compressed in a .tar.gz file
// end changes
Remember to upload this script to /vbroot/includes/cron!!
Does not work for me:-( Get:
MySQL backup
All Done
vBulletin v3.0.0 Release Candidate 3, Copyright ?2000-2004, Jelsoft Enterprises Ltd.
Fatal error: Call to undefined function: query() in /home/mywebiste/www/forum/includes/functions.php on line 501
But no backup is made:-(
alkahf
03-17-2004, 04:14 PM
That is the best hack in 2004.
Thank you
alkahf
03-18-2004, 11:22 AM
Hello
Yesterday I installed this hack like that :
https://vborg.vbsupport.ru/
Today I login to Ftp and I see that :
https://vborg.vbsupport.ru/
Tell me please what the problem?
Thank you
heynurse
03-19-2004, 06:55 AM
Does not work for me:-( Get:
MySQL backup
All Done
vBulletin v3.0.0 Release Candidate 3, Copyright ?2000-2004, Jelsoft Enterprises Ltd.
Fatal error: Call to undefined function: query() in /home/mywebiste/www/forum/includes/functions.php on line 501
But no backup is made:-(
I had this problem too at first, I had a space in my folder name, I removed the space and it worked fine. Not sure that will help you or not, but thought I'd try.
Natch
03-19-2004, 10:39 PM
Hello
Yesterday I installed this hack like that :
http://www.vbulletinclub.com/images/scheduled.png
Today I login to Ftp and I see that :
http://www.vbulletinclub.com/images/backup.png
Tell me please what the problem?
Thank you
No problem - except it seems you have the hack setup to run every minute ...
alkahf
04-03-2004, 04:07 AM
No problem - except it seems you have the hack setup to run every minute ...
Thank you Natch
But did you notice ( in my images ) that hack does not deleted last backup files?
untill now I deleted laste backup files manualy every day.
Tell me please what's the problem ?
Best regards :)
alkahf
Onkel_Tom
04-03-2004, 09:36 PM
This Hack only makes a backup of the database !
There ist no code for deleting old backups.
If you want to do that you have to add a line like
exec('rm ' .DUMP_PATH. '/yourolddatabasename.tar.gz');
in your cron_dbbackup.php file before backing up the actual db
Natch
04-05-2004, 03:21 AM
Or you can cause the hack to overwrite with the latest backup (weekly) by using the day of the week modification, instaed of the unix timestamp filename...
Onkel_Tom
04-06-2004, 06:13 PM
arggh !
I configured in the options to log the activity of this backup script, but I no activities are logged !
Script is running fine every day and backing up the db.
anybody an answer or solution ?
paulomt1
04-06-2004, 08:39 PM
Don'r work for me. no backups recorded.
:
Database Backup
Done
vBulletin v3.0.0, Copyright ©2000-2004, Jelsoft Enterprises Ltd.
My defs:
// Set these vars up to to suit your server
define('DB_HOST', 'localhost'); // database host
define('DB_USER', 'dbusername'); // database username
define('DB_PASSWORD', 'dbpass'); // database password
define('DB_NAME', 'dbname'); // vbulletins database name
define('DUMP_PATH', '/public_html/foruns/dbBackup'); // path to where db backup will be stored
define('DUMP_MAKE_TAR', 1); // set this to 1 for the backup to be compressed in a .tar.gz file
// end changes
What I made wrong?
Onkel_Tom
04-06-2004, 09:57 PM
define('DUMP_PATH', '/public_html/foruns/dbBackup'); // path to where db backup
Is this your correct absolute path to your folder ?
also there is a typo in forums ;)
Did you change your /forums/dbBackup folder to 777 with chmod ?
paulomt1
04-06-2004, 11:22 PM
Is this your correct absolute path to your folder ?
also there is a typo in forums ;)
Did you change your /forums/dbBackup folder to 777 with chmod ?
Thanks, the problem was the absolute path.
Now work great:)
anabolicedge
04-08-2004, 06:29 AM
Well this seems to be creating 3 new files in my backup folder but i'm still getting this error
Backup
Done
vBulletin v3.0.0, Copyright ©2000-2004, Jelsoft Enterprises Ltd.
Fatal error: Call to undefined function: query() in /home/anabol/public_html/forum/includes/functions.php on line 500
Can someone help?
anabolicedge
04-08-2004, 06:30 AM
oh and the files are
error.txt
*.sql - 0.13GB
*.tar.gz - 15mbs
Dark_Wizard
04-11-2004, 03:18 PM
Interesting hack and I could use this for a customers site, one quick question though, any plans on implementing a feature to email the backup? If not I will add it for myself as I could really use this feature...
Boofo
04-11-2004, 04:04 PM
Interesting hack and I could use this for a customers site, one quick question though, any plans on implementing a feature to email the backup? If not I will add it for myself as I could really use this feature...
I'd be intersted in that, also, buddy, if you don't mind sharing. ;)
Dark_Wizard
04-11-2004, 04:15 PM
I'd be intersted in that, also, buddy, if you don't mind sharing. ;)
NP...just waiting on the author to see if he wants to do it first since it is his hack otherwise I would like his permission. ;)
Boofo
04-11-2004, 04:25 PM
You could always PM it if you come up with something before you hear from the author. ;)
Dark_Wizard
04-11-2004, 05:48 PM
You could always PM it if you come up with something before you hear from the author. ;)
True...I'm almost done with it and have added zip as well....I will PM him with it once completed and fully tested.
Boofo
04-11-2004, 05:51 PM
Thank you, sir. Will be looking forward to it. ;) I have the attchmnets in PMs hack on my site if that will make it easier for you. ;)
Dark_Wizard
04-11-2004, 05:57 PM
Thank you, sir. Will be looking forward to it. ;) I have the attchmnets in PMs hack on my site if that will make it easier for you. ;)
Yes...I would like to look at it but where is it?
Boofo
04-11-2004, 06:00 PM
It's installed there. I got the hack from here. Kentaurus put it out. ;)
This is exacly what I need. But where, or how do I know if I have SQLDump o.O
Evilboy
04-22-2004, 02:14 AM
my problem :
Backup db
Fait
vBulletin v.3.0.0, Copyright ? 2000-2004, Jelsoft Enterprises Ltd. Tous droits r?serv?s - Version fran?aise vbulletin-fr.org
Fatal error: Call to undefined function: query() in /home/users/xmen/html/forum/includes/functions.php on line 500
config
// Set these vars up to to suit your server
define('DB_HOST', 'localhost'); // database host
define('DB_USER', 'xxx'); // database username
define('DB_PASSWORD', 'free'); // database password
define('DB_NAME', 'xxx'); // vbulletins database name
define('DUMP_PATH', '/home/users/xmen/backup'); // path to where db backup will be stored
define('DUMP_MAKE_TAR', 1); // set this to 1 for the backup to be compressed in a .tar.gz file
// end changes
what's the problem ?
Hey guys sorry for the delay, I will be updating this one soon, been very busy past few weeks. I'm going to test version 2 on a big database tonight, if all gose well it will be released in the next few days.
Improvements:
Email sent to $technicalemail addy when back-up process begins and finishes.
Search/postcache index cleared before dump is made, and re-built upon completion (yes/no option)
Session table cleared before backup-up
Board closed before back-up, and turned back on after
Custom 'board closed' message displayed while back-up is in process, it was added to ensure no one would be accessing the database via the board while it was begin backed up.
Blago
04-25-2004, 06:47 PM
Hey guys sorry for the delay, I will be updating this one soon, been very busy past few weeks. I'm going to test version 2 on a big database tonight, if all gose well it will be released in the next few days.
Improvements:
Email sent to $technicalemail addy when back-up process begins and finishes.
Search/postcache index cleared before dump is made, and re-built upon completion (yes/no option)
Session table cleared before backup-up
Board closed before back-up, and turned back on after
Custom 'board closed' message displayed while back-up is in process, it was added to ensure no one would be accessing the database via the board while it was begin backed up.
Thank you very much for your hard work.
Version 1.3 has been released, the only change is the ability for the script to leave cron logs, sorry I missed that.
I also updated the first post with some better install instructions, and more info on v2.0
MrNase
04-26-2004, 07:31 AM
Hey Brad :)
Is there a possibility to save the backup on different server?
Did you plan something like that for a future version?
I have not thought about it but ill look into it.
alkahf
04-26-2004, 08:48 AM
Version 1.3 has been released, the only change is the ability for the script to leave cron logs, sorry I missed that.
I also updated the first post with some better install instructions, and more info on v2.0
Hello
The same Error untill now
Fatal error: Call to undefined function: query() in /home/vbulleti/public_html/includes/functions.php on line 500
its working and saiving backup but without any cahnge with first version.
I waite version 2.0 :up:
Regards
alkahf
cLord
04-30-2004, 02:07 AM
Automatic Database Back-up
Fatal error: Call to a member function on a non-object in /home/website/public_html/includes/functions_cron.php on line 198
Fatal error: Call to undefined function: query() in /home/website/public_html/includes/functions.php on line 500
Can someone please help?
I get this message when I run the script manually, (the backup is made!)
When I try to run the script automated nothing happens! (no backup is made)
cLord :(
Logikos
04-30-2004, 08:27 AM
Seems im getting the same error as some others.
Automatic Database Back-up (hack)
Fatal error: Call to a member function on a non-object in /home/vbhacks/public_html/forum/includes/functions_cron.php on line 198
Fatal error: Call to undefined function: query() in /home/vbhacks/public_html/forum/includes/functions.php on line 500
I open includes/functions_cron.php on line 198 and this is what i see.
187: function log_cron_action($description, $nextitem)
188: {
189: global $DB_site;
190:
191: if (defined('ECHO_CRON_LOG'))
192: {
193: echo "<p>$description</p>";
194: }
195:
196: if ($nextitem['loglevel'])
197: {
198: $DB_site->query("
199: INSERT INTO " . TABLE_PREFIX . "cronlog
200: (cronid, dateline, description)
201: VALUES
202 ($nextitem[cronid], " . TIMENOW . ", '" . addslashes($description) . "')
203: ");
204: }
205: }
Then I open includes/functions.php on line 500 and this is what i see.
493: if (is_array($shutdownqueries))
494: {
495: $DB_site->reporterror = 0;
496: foreach($shutdownqueries AS $query)
497: {
498: if (!empty($query))
499: {
500: $DB_site->query($query);
501: }
502: }
503: $DB_site->reporterror = 1;
504: }
Any ideas?
nektar
05-01-2004, 05:37 PM
I have the same problem running 3.0.1
Fatal error: Call to a member function on a non-object in /var/www/html/forum/includes/functions_cron.php on line 198
Fatal error: Call to undefined function: query() in /var/www/html/forum/includes/functions.php on line 500
However, I can see the tar.gz file in the backup folder, which means that sqldump finished successfully? As i undertand it, an sql file is produced and then compressing takes place. Am I right?
Thank you.
nektar
05-01-2004, 05:41 PM
Removed the compression option but same error.
How can I check that I have full backup?
nektar
05-01-2004, 05:45 PM
GOT IT!!!!
I disabled Log Entries in the Schedule Task and now it works. ;)
Logikos
05-02-2004, 02:37 PM
GOT IT!!!!
I disabled Log Entries in the Schedule Task and now it works. ;)
I would like to be able to have log entries enabled
cLord
05-02-2004, 03:43 PM
I would like to be able to have log entries enabled
You're not the only one! ;)
Mr. HillBilly
05-06-2004, 02:45 AM
*sigh* This isn't even working. It was before then it just stopped.
All it says is back up done. but it just shows the .tar.gz file in the folder with nothing in it.
Version 1.3.1 was released and fixes all bugs in 1.3, please let me know how it gose for you.
Onkel_Tom
05-06-2004, 09:18 AM
Hi Brad.loo,
You forget this line in your script
define('DUMP_DATE', $file_date);
Onkel_Tom
05-06-2004, 09:43 AM
another question.
What about to include /includes/config.php in your db_backup script and just add the two lines to the config.php
$DUMP_PATH = '/path/to/dump/folder'; // path to where db backup will be stored
$DUMP_MAKE_TAR = '1'; // set this to 1 for the backup to be compressed in a .tar.gz file
then change in your db_backup script DUMP_PATH with $DUMP_PATH and DUMP_MAKE_TAR with $DUMP_MAKE_TAR
This will reduce the time for implement this script to another vB and also the paramters for the DB are centralized in the config.php and not twice in your script too.
I didn't try it right now, but I think this will work.
Boofo
05-06-2004, 10:10 AM
another question.
What about to include /includes/config.php in your db_backup script and just add the two lines to the config.php
$DUMP_PATH = '/path/to/dump/folder'; // path to where db backup will be stored
$DUMP_MAKE_TAR = '1'; // set this to 1 for the backup to be compressed in a .tar.gz file
then change in your db_backup script DUMP_PATH with $DUMP_PATH and DUMP_MAKE_TAR with $DUMP_MAKE_TAR
This will reduce the time for implement this script to another vB and also the paramters for the DB are centralized in the config.php and not twice in your script too.
I didn't try it right now, but I think this will work.
Could you show me how to set it up like that? I'd like to try it and see how it works. ;)
another question.
What about to include /includes/config.php in your db_backup script and just add the two lines to the config.php
$DUMP_PATH = '/path/to/dump/folder'; // path to where db backup will be stored
$DUMP_MAKE_TAR = '1'; // set this to 1 for the backup to be compressed in a .tar.gz file
then change in your db_backup script DUMP_PATH with $DUMP_PATH and DUMP_MAKE_TAR with $DUMP_MAKE_TAR
This will reduce the time for implement this script to another vB and also the paramters for the DB are centralized in the config.php and not twice in your script too.
I didn't try it right now, but I think this will work.
It is set up this way to allow you to have multiple copies to back up multiple databases, even ones that arent associated with vBulletin.
As for the DATE define it was replaced by a var, unless you spotted an old call to it that I missed? :)
O I see the missed call, I will update the script in a few minutes.
Ok fixed that little error, also made the file name more readable (it will be month-day-year.sql now).
No version change, but the file in the first post has been updated. :)
Boofo
05-06-2004, 03:40 PM
This is the name of my back up file now:
DUMP_DATE.tar.gz
It didn't pass the date to it.
When I add back this line:
define('DUMP_DATE', $file_date);
It works right.
Onkel_Tom
05-06-2004, 05:04 PM
Could you show me how to set it up like that? I'd like to try it and see how it works. ;)
I tested it a few minutes ago and it works fine ;)
This change is used to get the db_data directly from config.php without having this data in more scripts.
Okay, here we go:
step1:
open your /includes/config.php file and find:
// ****** DATABASE NAME ******
// This is the name of the database where your vBulletin will be located.
// This must be created by your webhost.
$dbname = 'your_db_name_here';
below that add:
// ****** DATABASE BACKUP HACK VIA CRON ******
// This is the absolute Path to your folder where the db backup will be stored.
// Use DUMP_MAKE_TAR = 1 for compressed tar.gz file
// Use DUMP_MAKE_TAR = 0 for normale .sql file
$DUMP_PATH = '/path/to/dump/folder';
$DUMP_MAKE_TAR = '1';
Don't forget to place your /path/to/dump/folder folder in this code !
Save and store config.php
step2:
now open your db_backup Script in /includes/cron folder. Should be named vbcron_db_backup_131.php
and replace:
// ######################## Begin edits ######################
define('DB_HOST', 'localhost'); // database host
define('DB_USER', 'db_user'); // database username
define('DB_PASSWORD', 'password'); // database password
define('DB_NAME', 'db_name'); // vbulletins database name
define('DUMP_PATH', '/path/to/dump/folder'); // path to where db backup will be stored
define('DUMP_MAKE_TAR', 1); // set this to 1 for the backup to be compressed in a .tar.gz file
// ####################### End Edits ##########################
// for some reason beyound me query was un-defined for some users, so this is here as an attempt to fix it...
require_once('./global.php');
with:
// for some reason beyound me query was un-defined for some users, so this is here as an attempt to fix it...
require_once('./global.php');
// get db requirements from config.php
require('./includes/config.php');
step3:
now replace:
// Get .sql file
exec('mysqldump --add-drop-table -h' .DB_HOST. ' -u' .DB_USER. ' -p' .DB_PASSWORD. ' ' .DB_NAME. ' 2>' .DUMP_PATH. '/' .$file_date. '-error.txt >' .DUMP_PATH. '/' .$file_date. '.sql');
$log_db = 'Saved backup of databse to ' . DUMP_PATH . ' at ' . $file_date . ' (file name ' . $file_date . '.sql';
with
// Get .sql file
exec('mysqldump --add-drop-table -h' .$servername. ' -u' .$dbusername. ' -p' .$dbpassword. ' ' .$dbname. ' 2>' .$DUMP_PATH. '/' .$file_date. '-error.txt >' .$DUMP_PATH. '/' .$file_date. '.sql');
$log_db = 'Saved backup of databse to ' . $DUMP_PATH . ' at ' . $file_date . ' (file name ' . $file_date . '.sql';
step4:
now replace
// now archive and compress the backup, also delete .sql file
exec('tar -cSz --remove-files -C' .DUMP_PATH. ' -f' .DUMP_PATH. '/' .DUMP_DATE. '.tar.gz ' .$file_date. '.sql ' .$file_date. '-error.txt');
$log_db = 'Saved backup of databse to ' . DUMP_PATH . ' at ' . $file_date . ' (file name ' . $file_date . '.tar.gz';
with
// now archive and compress the backup, also delete .sql file
exec('tar -cSz --remove-files -C' .$DUMP_PATH. ' -f' .$DUMP_PATH. '/' .$file_date. '.tar.gz ' .$file_date. '.sql ' .$file_date. '-error.txt');
$log_db = 'Saved backup of databse to ' . $DUMP_PATH . ' at ' . $file_date . ' (file name ' . $file_date . '.tar.gz';
save and store vbcron_db_backup_131.php
step5:
upload config.php to /includes/
upload vbcron_db_backup_131.php to /includes/cron
and look how it works ;)
Onkel_Tom
05-06-2004, 05:07 PM
This is the name of my back up file now:
DUMP_DATE.tar.gz
It didn't pass the date to it.
When I add back this line:
define('DUMP_DATE', $file_date);
It works right.
Yes, Brad.loo forgot to change the parameter in the tar-routine !
Just search for
// now archive and compress the backup, also delete .sql file
exec('tar -cSz --remove-files -C' .DUMP_PATH. ' -f' .DUMP_PATH. '/' .DUMP_DATE. '.tar.gz ' .$file_date. '.sql ' .$file_date. '-error.txt');
$log_db = 'Saved backup of databse to ' . DUMP_PATH . ' at ' . $file_date . ' (file name ' . $file_date . '.tar.gz';
and replace it with:
// now archive and compress the backup, also delete .sql file
exec('tar -cSz --remove-files -C' .DUMP_PATH. ' -f' .DUMP_PATH. '/' .$file_date. '.tar.gz ' .$file_date. '.sql ' .$file_date. '-error.txt');
$log_db = 'Saved backup of databse to ' . DUMP_PATH . ' at ' . $file_date . ' (file name ' . $file_date . '.tar.gz';
Boofo
05-06-2004, 05:24 PM
There's something wrong because it isn't doing anything now. It says it made the backup, but it was alot quicker than normal and there is no file there. I followed your instructions exactly. :(
Onkel_Tom
05-06-2004, 09:15 PM
Boofo, you are right ;)
I was in a hurry while posting the changes and do a mistake in step3 !
Please do again step 3 and the change will work, I forgot to replace the old variables with the new one from config.php
Sorry !
Onkel_Tom
05-06-2004, 10:02 PM
Okay, I wrote down the installation instruction for the change to handle all database parameters directly from config.php in few lines.
Boofo
05-06-2004, 11:34 PM
Okay, I wrote down the installation instruction for the change to handle all database parameters directly from config.php in few lines.
I will try it now. ;)
Boofo
05-06-2004, 11:54 PM
Ok, it works. I had to change this (in your instructions file):
if (DUMP_MAKE_TAR == '1')
to this (to get it to compress it, though):
if ($DUMP_MAKE_TAR == '1')
But other than that, great job and thank you, sir. ;)
Onkel_Tom
05-07-2004, 08:59 AM
Ok, it works. I had to change this (in your instructions file):
if (DUMP_MAKE_TAR == '1')
to this (to get it to compress it, though):
if ($DUMP_MAKE_TAR == '1')
But other than that, great job and thank you, sir. ;)
I updated the instruction file !
Thanks Boofo ;)
Sorry for all the updates guys, fixed that last missed DUMP_DATE. No version change but new file in the first post.
Haven't been getting much sleep as of late, so thanks for catching all these for me, I belive the one up now should be stable enough to run until I get 2.0 wrapped up :)
Boofo
05-07-2004, 10:00 AM
Sorry for all the updates guys, fixed that last missed DUMP_DATE. No version change but new file in the first post.
Haven't been getting much sleep as of late, so thanks for catching all these for me, I belive the one up now should be stable enough to run until I get 2.0 wrapped up :)
Brad, I hope you are going to use Onkel_Tom's code when you update to the new version. It works flawlessly and I like the idea that my password and other info isn't in 3 or 4 files when it only needs to be in one. ;)
Onkel_Tom
05-07-2004, 01:22 PM
For my "old" friend Boofo now a restore script for the database backups to try.
All is explained in the script itself, and please corect my bad english, I'm german and learned english only in school ;)
Please remove the script after testing from your server because it's a to big security risc to leave them at the server!
Should be only used if a restore of an backup must be done.
Boofo
05-07-2004, 01:37 PM
For my "old" friend Boofo now a restore script for the database backups to try.
All is explained in the script itself, and please corect my bad english, I'm german and learned english only in school ;)
Please remove the script after testing from your server because it's a to big security risc to leave them at the server!
Should be only used if a restore of an backup must be done.
You just keep them coming, sir. I will test this out. And, thank you, again. ;)
Evilboy
05-07-2004, 02:45 PM
pb :
Backup db
Database backup script was invoked without error, to check that it was done correctly see if the file was written to the folder you specified in the configuration variables. It may take some time before your server finishes backing up depending on the size of your database
?
pb :
Backup db
Database backup script was invoked without error, to check that it was done correctly see if the file was written to the folder you specified in the configuration variables. It may take some time before your server finishes backing up depending on the size of your database
?
This is new, to let you know that the php part is done, but the back-up may or may not be finished.
The script will not automaticly throw a 'done' message like most vbcron scripts.
xQuEeNzNaZcHox
05-18-2004, 07:07 PM
Great hack, one question: I turned on Log Entries, and I looked in the folder where the backup was (after it had backed up), and it had a file called "05-18-04-error.txt." It had nothing on it.
Anything wrong here?
Matrixgl
05-24-2004, 10:04 PM
I am not trying to discourage people from using this hack, but this is just a suggestion for people who wants more features.
The script that I use can be used to make backups of any database, and it has all the features that you probably need.
Backup multiple databases and servers with different users and passwords.
Backups can be scheduled using cron (on UNIX systems) or AT (on Windows systems).
Create daily, weekly and monthly snpashots of your database.
Keep the daily, weekly and monthly backups for a user-specified time.
Archive and compress the SQL files (*.tar.gz).
Creates a detailed report of everything that has been done.
Reports can be mailed to you or any other user- specified email- address, saved to disk or displayed in browser.
Generated SQL files can be mailed to you or any other user-specified email-address.
Generated SQL files can be saved on the server.
Choose to create SQL files for each table or one for each database.
No system calls, everything in 100% pure PHP. PHP Safe-mode compatible.
http://restkultur.ch/personal/wolf/scripts/db_backup/
Boofo
05-24-2004, 10:31 PM
I am not trying to discourage people from using this hack, but this is just a suggestion for people who wants more features.
The script that I use can be used to make backups of any database, and it has all the features that you probably need.
Backup multiple databases and servers with different users and passwords.
Backups can be scheduled using cron (on UNIX systems) or AT (on Windows systems).
Create daily, weekly and monthly snpashots of your database.
Keep the daily, weekly and monthly backups for a user-specified time.
Archive and compress the SQL files (*.tar.gz).
Creates a detailed report of everything that has been done.
Reports can be mailed to you or any other user- specified email- address, saved to disk or displayed in browser.
Generated SQL files can be mailed to you or any other user-specified email-address.
Generated SQL files can be saved on the server.
Choose to create SQL files for each table or one for each database.
No system calls, everything in 100% pure PHP. PHP Safe-mode compatible.
http://restkultur.ch/personal/wolf/scripts/db_backup/
How hard is it to set up?
Matrixgl
05-24-2004, 10:47 PM
not hard, just unzip/untar, upload, change the variables in config.inc.php and thats it. You have to set up a cron though. You can either do it using telnet or cpanel.
See the installation section on the site.
Fluous
06-03-2004, 08:35 PM
So this is all done and I can download it? Like it should work on my system? And I should download the db back up but only put it on my server when I need to back up?
Bulent Tekcan
06-04-2004, 12:24 PM
When I use this script my DB is 411MB but in AdminCP VBBackup system make a 444MB ??? Why different size ? Also both extension is .sql
Thanks
Bulent Tekcan
06-05-2004, 12:14 PM
When I use this script my DB is 411MB but in AdminCP VBBackup system make a 444MB ??? Why different size ? Also both extension is .sql
Thanks
I cannot receive any answer my questions manytimes.....
Anybody knows why size is diffrent ????
Bahawolf2
06-05-2004, 02:53 PM
I am not trying to discourage people from using this hack, but this is just a suggestion for people who wants more features.
The script that I use can be used to make backups of any database, and it has all the features that you probably need.
Backup multiple databases and servers with different users and passwords.
Backups can be scheduled using cron (on UNIX systems) or AT (on Windows systems).
Create daily, weekly and monthly snpashots of your database.
Keep the daily, weekly and monthly backups for a user-specified time.
Archive and compress the SQL files (*.tar.gz).
Creates a detailed report of everything that has been done.
Reports can be mailed to you or any other user- specified email- address, saved to disk or displayed in browser.
Generated SQL files can be mailed to you or any other user-specified email-address.
Generated SQL files can be saved on the server.
Choose to create SQL files for each table or one for each database.
No system calls, everything in 100% pure PHP. PHP Safe-mode compatible.
http://restkultur.ch/personal/wolf/scripts/db_backup/
The only problem I experienced with this script was when a database copy was already there, and it tried backing it up again, which caused the new backup to increase in size ridicuously (monitored by refreshing on WSFTP) until it just stalled. I have a cron setup obviously.. any advice?
As for this hack, I had no success in getting my backup. It makes a .tar the size of 1KB without any files.
SaN-DeeP
06-06-2004, 09:10 PM
:S
Noone using this error got this except me.
i guess, my hosting provider has banned/blocked something or its me ?
Here is the Error. no db backup is created in my backup dir which is properly CHMOD.
Warning: exec() has been disabled for security reasons in /forums/includes/cron/vbcron_db_backup_131.php on line 38
Warning: exec() has been disabled for security reasons in /forums/includes/cron/vbcron_db_backup_131.php on line 47
Database backup script was invoked without error, to check that it was done correctly see if the file was written to the folder you specified in the configuration variables. It may take some time before your server finishes backing up depending on the size of your database
need help.
Thnx.
Sandy...
Bahawolf2
06-06-2004, 11:00 PM
:S
Noone using this error got this except me.
i guess, my hosting provider has banned/blocked something or its me ?
Here is the Error. no db backup is created in my backup dir which is properly CHMOD.
Warning: exec() has been disabled for security reasons in /forums/includes/cron/vbcron_db_backup_131.php on line 38
Warning: exec() has been disabled for security reasons in /forums/includes/cron/vbcron_db_backup_131.php on line 47
Database backup script was invoked without error, to check that it was done correctly see if the file was written to the folder you specified in the configuration variables. It may take some time before your server finishes backing up depending on the size of your database
need help.
Thnx.
Sandy...
I forgot what this was called..
I think its something with php.. like php(exec) or something..
Your host may have it disabled.. let me check into this further.
Hey guys, ive been busy again.
2.0 is coming, just alot of code to make sure these commands are correct for all options. Advanced users are going to enjoy some more control over the way back-ups are made, and you will have the option of dumping the raw db files instead of a .sql text file.
The new version should work on any mysqldump or mysqlhotcopy command enabled server, I have some more testing to do before I feel ok about releasing it, but I promise it'll be up soon. :)
Aurous
06-09-2004, 10:40 PM
sweet, have been waiting for version 2.0 since it was announced! cant wait :cool:
sweet, have been waiting for version 2.0 since it was announced! cant wait :cool:
Aye sorry about the wait, been hitting the books, still got four more tests to do before I get lots more free time :). This is something im using on my own site aswell, it's getting stress tested over and over as I test ipb imports.
Natch
06-11-2004, 01:05 PM
brad.loo - ust letting you know but I have found that this script has caused seg faults and 83% CPU usage while running ... Your account is using a backup recovery program which is causing the server
load to be very unstable and prone to http segmentation fault errors.
Top Process %CPU 85.3 tar -cSz --remove-files -C/home/mofo/forumdump
- f/home/mofo/forumdump/Wednesday.tar.gz Wednesday.sql Wednesday- error.txt
Top Process %CPU 85.2 tar -cSz --remove-files -C/home/mofo/forumdump -
f/home/mofo/forumdump/Wednesday.tar.gz Wednesday.sql Wednesday- error.txt
Top Process %CPU 84.8 tar -cSz --remove-files -C/home/mofo/forumdump -
f/home/mofo/forumdump/Wednesday.tar.gz Wednesday.sql Wednesday- error.txt
Just a FYI - the DB I'm backing up is not very large - I dunno if it's a peculiartiy to my server, or what - but worth looking into ...
MrNase
06-15-2004, 04:59 PM
Hey Brad, is 2.0 done? ;)
Iam waiting for it soooo badly because i really need that hack :(
teksigns
06-15-2004, 05:18 PM
looking for 2.0 ...... where are you ?
lol
bahawolf
06-15-2004, 06:35 PM
Doesn't appear 2.0 is done.. :/
SaN-DeeP
06-15-2004, 11:05 PM
Doesn't appear 2.0 is done.. :/
wait and dont cry
it will be out when it is out :)
Bahawolf2
06-16-2004, 02:54 AM
I wasn't.. ;)
I was simply telling the other members that it wasn't done because that was like the second member asking for it.. ;)
2.0 is coming guys, you just have to wait a bit longer.
brad.loo - ust letting you know but I have found that this script has caused seg faults and 83% CPU usage while running ...
I have not seen cpu that high with the script before, altho it is very possible depending on the server and amount of traffic on it.
Natch
06-22-2004, 01:37 AM
It was just related to this script, particularly to the level of compression used in the tar-gz
2.0 will solve this indirectly, while it will still make tar's if you want, you can set it to use other compresstion engines.
Aurous
06-27-2004, 08:22 PM
2.0 is coming guys, you just have to wait a bit longer.
Its been about a week since you announced that, so wondering how long it will take to get this out. Well if its taking longer, thats fine, take your time, test it for bugs, etc. .. no hurry :-)
stamos2003
06-28-2004, 11:59 AM
very cool and usefull, thx. !
Its been about a week since you announced that, so wondering how long it will take to get this out. Well if its taking longer, thats fine, take your time, test it for bugs, etc. .. no hurry :-)
I did'nt have time this weekend due to a death in the family, i'm back on the job now :)
gwhooooey
07-11-2004, 05:23 AM
Any update on the new version?
WEForums
07-15-2004, 01:20 AM
Nice and all. Installed.
I'm just wondering, though, if there is any way I could see if it's a full database backup? Opening the file is a little rough with having so many users and posts, so it requires so much RAM...
So how would I know if it's a good backup? Just estimate the size?
teksigns
07-15-2004, 02:08 AM
any estimate on 2.0 ?
been holding off installing this one in hopes of the new version ....
gwhooooey
07-15-2004, 02:36 AM
any estimate on 2.0 ?
been holding off installing this one in hopes of the new version ....
Same
Koutaru
07-15-2004, 05:39 AM
I did'nt have time this weekend due to a death in the family, i'm back on the job now :)
Sorry to hear that :( I hope you're alright
^_^ Delete last .sql (or .tar.gz) file when doing current back-up is the only part I'm really looking forward to.
Bison
07-24-2004, 04:34 AM
Yeah ... take your time Brad.loo. Personal life is most important!
Don't rush because a few can't wait. With some time, I know you'll produce a great script! :)
Sanity
07-27-2004, 02:28 PM
Thx for this skript!
I use it once per day and it is great. But I get always three files instead of one: I got the error.txt, the *.sql and the *.tar.gz files. Everything seems to be ok but i would like only to have the *.tar.gz file.
SnowBot
07-27-2004, 03:14 PM
Yeah ... take your time Brad.loo. Personal life is most important!
Don't rush because a few can't wait. With some time, I know you'll produce a great script! :)
I agree, its working great as it is so we can hang for the update, just relax for awhile :)
xTerMn8R
08-05-2004, 07:10 PM
Will this hack also work on a Windows 2000 Server running VB 3.03?
NietzscheKid
08-05-2004, 07:43 PM
My condolences Brad. :(
weirdpixels
08-12-2004, 12:40 PM
will this hack work if I have my database on one server and my vb files etc on another?
SamirDarji
10-21-2004, 07:31 PM
Any news on 2.0? Will it work with 3.0.3? Can someone summarize the changes that are available to this hack?
SamirDarji
10-21-2004, 10:02 PM
I am not trying to discourage people from using this hack, but this is just a suggestion for people who wants more features.
The script that I use can be used to make backups of any database, and it has all the features that you probably need.
Backup multiple databases and servers with different users and passwords.
Backups can be scheduled using cron (on UNIX systems) or AT (on Windows systems).
Create daily, weekly and monthly snpashots of your database.
Keep the daily, weekly and monthly backups for a user-specified time.
Archive and compress the SQL files (*.tar.gz).
Creates a detailed report of everything that has been done.
Reports can be mailed to you or any other user- specified email- address, saved to disk or displayed in browser.
Generated SQL files can be mailed to you or any other user-specified email-address.
Generated SQL files can be saved on the server.
Choose to create SQL files for each table or one for each database.
No system calls, everything in 100% pure PHP. PHP Safe-mode compatible.
http://restkultur.ch/personal/wolf/scripts/db_backup/
I've been messing with this for a little while in a scheduled task in the vb cron. On my local test server, it works fine. But on the production server, I get a "Internal Server Error" when I try to manually run the job. Any clues?
dethfire
11-04-2004, 06:44 PM
yeah any status? seems like a few months since an update
dethfire
11-04-2004, 06:48 PM
also will this timeout on a large database?
HiDeo
11-04-2004, 07:13 PM
Nice jobs thanks
HiDeo
11-04-2004, 07:33 PM
I have an error:
Warning: exec() has been disabled for security reasons in /home/.sites/**/*****/web/includes/cron/vbcron_db_backup_131.php on line 38
Warning: exec() has been disabled for security reasons in /home/.sites/**/*****/web/includes/cron/vbcron_db_backup_131.php on line 47
Database backup script was invoked without error, to check that it was done correctly see if the file was written to the folder you specified in the configuration variables. It may take some time before your server finishes backing up depending on the size of your database
No idea ?
Jesse Jericho
11-08-2004, 01:30 PM
Installed! Thanks.
*edit* I noticed that the backup script isn't shutting down the forum while it is working, is this right?
alkatraz
11-25-2004, 05:31 PM
works great! thank you
TJFweb
11-26-2004, 11:26 AM
Does anyone if it's possible to have this script run in batches of tables in order to avoid mysql run out of memory errors?
muse.mu
12-14-2004, 12:14 PM
any update of the new version? :)
jluerken
12-23-2004, 05:05 PM
any update of the new version? :)
When will you release version 2?
SaN-DeeP
12-24-2004, 02:50 AM
When will you release version 2?
I am expecting this to be added as a feature in new vbulletin :)
Johannes de Le?n
12-24-2004, 07:16 AM
Thank you, it works like a charm on 3.0.3.
/me clicks install
Jolten
02-07-2005, 07:27 AM
Thanks Brad!
ambrosious
02-19-2005, 05:32 PM
Does anyone know: How to overwrite the previous day's backup?
Also, the script doesn't seem to put anything in my backup folder and the path is set correctly ie 'home/ambro/public_html/vbulletin/backup/' so I'm lost and looking for ideas.
almqdad
03-08-2005, 08:11 AM
this hach is good but it needs upgrade
when
caislander
03-31-2005, 03:55 AM
Anybody,
I have installed this hack and when I run it from the control panel it says that it was invoked with no errors and the log says that it wrote a file to the folder but when i go to the folder there is nothing there?? can anyone give me an idea what is wrong?
thanks
Rambo
05-31-2005, 11:24 AM
*installs*
Great mod! works perfectly =).
Logikos
08-29-2005, 04:38 PM
Hey brad, you think this same file will work for 3.5?
TheEDIGuy
03-01-2006, 04:46 PM
Sure would be nice if the author of this vbcron would update it for 3.5.x. I loved this thing.
nitro
03-01-2006, 07:01 PM
The file works fine in 3.5x but logging is broken, change
$DB_site to $vbulletin->db
and
comment out the log line leave the echo line. Doubt it would take much to fix the logging function but I dont have time right now.
TheEDIGuy
03-03-2006, 07:37 PM
It doesn't work, even with the change. It has something to do with the include at the beginning of the file.
I've played with it, but don't know enough about it to be able to fix it, unfortunately.
GTAce
03-03-2006, 07:46 PM
Hopefully I don't get reamed for this, but since this mod is so outdated, I figured I'd let you know about an alternative...I've written a similar tutorial that will get this done...which is actually not version or software dependent - so it will work on any software, any MySQL database for that matter...The current script will maintain a rolling copy of the latest 3 backups, but I plan to write more in the future that will save more backups and some that will give you the ability to run both daily and/or weekly and monthly backups...Anywho, you can find it here (http://www.adminfusion.com/forums/showthread.php?t=2127)
Logikos
04-26-2006, 08:34 AM
I ported this exact hack to 3.5.4 with Brads permissions. You can find the 3.5.4 version here: https://vborg.vbsupport.ru/showthread.php?t=114097 :)
rb2k1
07-18-2007, 08:34 PM
I go this to work 100% in vBulletin 3.6.5 by doing the following:
Replace:
// for some reason beyound me query was un-defined for some users, so this is here as an attempt to fix it...
require_once('./global.php');
if ($DB_site == NULL)
{
exit;
}
With:
// for some reason beyound me query was un-defined for some users, so this is here as an attempt to fix it...
// require_once('./global.php');
if ($vbulletin->db == NULL)
{
exit;
}
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.