The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
cron job for a SQL function???
Is there a way to create a scheduled task that will run a SQL query. I would like to create one that will run on schedule a SQL function that, at say 3AM (a low user load time), that will make a copy of my database with a date and time stamp on the name it saves. I can handle the date and time stamp on the file name with SQL. I just need to know if I can automate the SQL function.
Thanks! Buster |
#2
|
||||
|
||||
You can drop a vb script (with access to the mysql classes) into includes/cron and set it up as a cron in the admincp.
Alternatively, you can use a scripting language with mysql support and set it up using the system cron. Both ways will work fine, although with the vb approach the cron will fire the first time someone (anyone) views some part of your site on or after your trigger time. |
#3
|
|||
|
|||
OK, you just went over my head. How do I implment what you're saying?
Thanks! Buster |
#4
|
||||
|
||||
Yes, you can do it. All the cron jobs are kept in the includes/cron/ folder. Just find a simple one, give it a new name, remove the code in the middle, and add your own code instead. Save. Create a scheduled task to run it.
|
#5
|
|||
|
|||
OK, maybe I was giving myself too much credit. How would I write the script to just get it to make a copy and save it somewhere on the server with a static name. In other words if my DB is called vbdatabase and I want it to dump to a folder off the root called backup, overwriting the previous file, how would I code that?
Thanks! |
#6
|
||||
|
||||
Have you thought of installing one of the mods written to already do this? (search "backup" "all mods" "titles only")
|
#7
|
|||
|
|||
Holy cow, wouldn't have thought there was such a mod out there. Wonder if there's one that can do a backup of an entire folder like that. Spose I'll have to search for that too now.
Thanks for pointing me in the right direction Lynne. Buster |
#8
|
||||
|
||||
Look no further than my profile for that sort of mod. It's the only mod I've ever submitted.
|
#9
|
|||
|
|||
Sweet, i was just looking at that mod!
Great work Lynne! Buster |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|