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 |
#12
|
|||
|
|||
Still getting the same error. Hmmm......
|
#13
|
|||
|
|||
Here's my attached file, Lynne -- as my email client is acting up lol.
|
#14
|
||||
|
||||
For some reason, the lines are getting all run together by your editor and that is why you are getting the error.
For instance, your file line 1 shows: Code:
<?php/*======================================================================*\ Code:
<?php |
#15
|
|||
|
|||
I believe that is from:
Code:
/*======================================================================*\ || #################################################################### || || # Cron Job to backup all avatars, profiles, and attachments || || # Last Modified: December 04, 2007 || || #################################################################### || \*======================================================================* Just ran it again, and it worked. However, files are not showing up. I've cmod the backups folder, still isn't working. This is really strange. |
#16
|
||||
|
||||
Quote:
Is the action getting logged, just not producing any output? Are you getting any files output? Did you run it 'as-is' or with your modifications? Do you know if passthru() is an allowable function on your server? |
#17
|
|||
|
|||
Quote:
|
#18
|
|||
|
|||
Hello Lynne,
Haven't seen if passthru() is enabled on my server, yet (although I think it is) -- but I just noticed the attach, avatars, and profilepics in my forums directory as a .tar file. Any ideas as to why it is saving too my forums directory? I certainly don't have that set for the backup folder. |
#19
|
||||
|
||||
Quote:
It sounds like either you don't have the correct path set for the backup directory you want them to be moved to, or you don't have the correct permissions set for the directory. The script makes the backup and then moves the file. Looking at the file you attached above, you have this as your line: $backupto = "/home/user/backups1"; You need to add the trailing slash. It should be: $backupto = "/home/user/backups1/"; |
#20
|
|||
|
|||
Hi Lynne,
That is an old file, the new one has the trailing slash. I have also cmod the folder to 777. Any other suggestions..... ? |
#21
|
||||
|
||||
I'd have to look at the form to see if something else is wrong. You can try attaching it here or sending it via email (if you have that working again). It seems that if the permissions and ownership is correct, it should work.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|