Welcome, Guest. Please Login or Register.
October 09, 2024, 02:18:50 PM
Home Help Search Log in Register
News: If you are still using YaBB SE, please consider upgrading to SMF as soon as possible.

YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  Daily Auto-Dump of the database mod « previous next »
Pages: [1] Reply Ignore Print
Author Topic: Daily Auto-Dump of the database mod  (Read 1011 times)
Smitty
Noobie
*
Posts: 21


WWW
Daily Auto-Dump of the database mod
« on: October 18, 2003, 11:01:19 PM »
Reply with quote

Is there a mod that will auto dump my YabbSE database on a regular basis? The reason I'm looking for this, is because about 3 weeks ago, I lost everything in my database and had to rebuild my board that had over 4000 post. I'm away from home alot and need a mod that will dump the database everyday to a specified directory on my site, just incase the board goes haywire, I can do a restore.


I'm using the supermod version of YabbSE, and I know I have the option of letting the Global Moderators do the dump on a manual basis, but Auto-Dump would be cool to have.

Thanks in advance
Logged
Shadow's Pawn
Support Team
YaBB God
*****
Posts: 597


ich soll nicht toten

ICQ - 8039201shadowpawn@hotmail.com WWW
Re:Daily Auto-Dump of the database mod
« Reply #1 on: October 19, 2003, 02:13:08 AM »
Reply with quote

This wouldn't work.

You would have to instead write a script on your own machine to connect to the board and do a dump, but the board would not be able to auto-dump to your computer.
Logged

apologize \A*pol"o*gize\, v. i. - To lay the foundation for a future offense.
Smitty
Noobie
*
Posts: 21


WWW
Re:Daily Auto-Dump of the database mod
« Reply #2 on: October 19, 2003, 09:28:46 PM »
Reply with quote

I think it can be done. I wouldn't want it to be written to my computer, instead write it to a directory on my web-server.


I have a guestbook on my site that is written in perl, and it does a auto backup of my book and emails it to me, so I figure one could be written in php to do the same for a yabb board.
Logged
Shadow's Pawn
Support Team
YaBB God
*****
Posts: 597


ich soll nicht toten

ICQ - 8039201shadowpawn@hotmail.com WWW
Re:Daily Auto-Dump of the database mod
« Reply #3 on: October 20, 2003, 01:27:10 AM »
Reply with quote

You could back it up to the server, sure, but you wouldn't be able to email it to yourself or anything like that automatically.  The dump would just be too large, unless your board is really small.
Logged

apologize \A*pol"o*gize\, v. i. - To lay the foundation for a future offense.
Smitty
Noobie
*
Posts: 21


WWW
Re:Daily Auto-Dump of the database mod
« Reply #4 on: October 20, 2003, 06:02:07 PM »
Reply with quote

Is there a mod that will back it up auto to a web server? I don't want it emailed to me, just back it up to my webserver
Logged
Coyote
YaBB God
*****
Posts: 702


I love YaBB SE!

Re:Daily Auto-Dump of the database mod
« Reply #5 on: October 23, 2003, 11:24:01 PM »
Reply with quote

Yeah this can be done,

You need to write a bash script that dumps the DB to a file. and then send you an email to say that its been backed up ;)

To automate it, you will have to se up something called a Cron Job (aka crontab)

I dont have time to post specific details at the moment, but thought you might like the above info - at least its a start for you :)
Logged

To the world - you are just one person, but to one person you are the world!
Coyote
YaBB God
*****
Posts: 702


I love YaBB SE!

Re:Daily Auto-Dump of the database mod
« Reply #6 on: October 24, 2003, 12:14:30 AM »
Reply with quote

Create a file called daily.sh


#!/bin/sh
cd /home/username
rm mybackup.sql
mysqldump --opt -p{DBpassword} -u {DBusername} -B {databaseName} > mybackup.sql
cat msg.txt | /usr/lib/sendmail -t


Create another file called msg.txt


From: [email protected]
To: [email protected], [email protected]
Subject: Daily Backup Routine

Begin your message here. It is very important to leave a blank line before you start the body of your message.
The Backup Routine has been executed


Place them both above your public_html directory - in your user directory.

You then need to use Control Panel to setup a cron job with these paremeters.... Feel free to change them, but they work out to be 2am everyday ;) when its less busy.

Minute: 0
Hour: 2
Day: *
Month: *
Weekday: *

So it looks like this...........

0 2 * * * {username} /home/username/daily.sh


I havent tested this, but will do over the next couple of days.

I hope it helps - but please check with your host before using this script, as messing with Cron Jobs can cause the server to go dizzy ;) (if you(or I)get it wrong!)

Oh, you obviously have to change the username/dbnames in the scripts and also take out the curly brackets ;)

And CHMOD the bash script to 755.

Good luck

Tony,


Logged

To the world - you are just one person, but to one person you are the world!
Smitty
Noobie
*
Posts: 21


WWW
Re:Daily Auto-Dump of the database mod
« Reply #7 on: October 25, 2003, 05:14:58 AM »
Reply with quote

Cool, I'll play around with it and see what I can get done. Thanks for the help
Logged
Pages: [1] Reply Ignore Print 
YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  Daily Auto-Dump of the database mod « previous - next »
 


Powered by MySQL Powered by PHP YaBB SE Community | Powered by YaBB SE
© 2001-2003, YaBB SE Dev Team. All Rights Reserved.
SMF 2.1.4 © 2023, Simple Machines
Valid XHTML 1.0! Valid CSS

Page created in 0.024 seconds with 20 queries.