The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Cron job for Files Backup (attachments, avatars, etc.) Details »» | |||||||||||||||||||||||||||
Cron job for Files Backup (attachments, avatars, etc.)
Developer Last Online: Oct 2022
This is a script meant to run as a Scheduled Task to backup your files if you have your attachments, avatars, etc. in the file system. I have been running it for a couple of years now and given it to a few other vb admins and figured I should share it here as my first Mod. I found the basic part of the script somewhere online a couple of years ago and modified it to work with vbulletin.
Installation: Download the file and modify the variables at the top of the file. The $backupdir should be an absolute path to a folder you wish to backup. Make sure you have a trailing "/" in the path. The $backupto variable is the absolute path to the folder for your backups. It should also have a trailing "/" in the path. Once you fill in those variables, upload the file to your "includes/cron/" directory and go to your Admin CP > Scheduled Tasks > Add New Scheduled Task and create a new task to run the script. I run mine every night (as seen in the attachment). Notes: The script I have attached is made to backup three different directories. You may add more or take away some. But, make sure if you add more at the top ($backupdir4, $fileprefix4) that you add them to the backupsus call. I used to have these variables set as globals in the function, however that stopped working for me after my last upgrade and instead of figuring out if this was a server issue, I simply changed the script to accommodate the change. I have heard that some servers do not allow the use of the passthru() function. I can't help with that as I really don't know anything about servers and their personalities. Also, I assume this will work with windows servers also, but I can't help with that either as I have absolutely no experience with windows servers. This works for me and I hope it works for you to. I'm big on having backups around as it helps me sleep better at night. And, thanks to Boofo for encouraging me to release my first modification! Update: 1.0.1 - I forgot a semi-colon at the end of the $backupdir lines 1.0.2 - was: $backupattach = "cd $backupdir2; s/b : $backupattach = "cd $backupdir3; Show Your Support
|
Comments |
#2
|
||||
|
||||
My test site is running 3.7 beta 2 and this script works fine. I don't see any reason why it won't work on the newer versions.
|
#3
|
||||
|
||||
Nice! Thanks! *installed*
|
#4
|
|||
|
|||
I was thinking of something like this, too. Very handy! Thanks, Lynne. Will install tomorrow, as I currently have a lot on my plate hehe.
|
#5
|
||||
|
||||
does/can this also backup the database?
|
#6
|
|||
|
|||
No, it doesn't backup the database. You would need a mod such as this for that: https://vborg.vbsupport.ru/showthread.php?t=167276
Installed, Lynne! Thanks. |
#7
|
|||
|
|||
Hi Lynne,
Getting the following: Quote:
|
#8
|
||||
|
||||
Hmmm, error on line 9. My line 9 is blank.
Make sure your $backupdir4 ends with a trailing slash. Also, make sure when you call the function with "backupsus ($.....)" that the order of the variables in there is the same as the order of variables in the "function backupsus ($.....)" Uh oh... I just noticed I'm missing a semi-colon at the end of the $backupdir2 and $backupdir3. The $backupdir lines should look like this: $backupdir1 = "/my/path/to/avatars/"; $backupdir2 = "/my/path/to/customprofilepics/"; $backupdir3 = "/my/path/to/attachments/"; I'll update the first post with the corrected file. |
#9
|
|||
|
|||
All becomes clear...
Thanks! |
#10
|
||||
|
||||
Thanks for pointing that out. I guess I dropped the semi-colon when I made the file 'generic' to be released.
|
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|