Register Members List Search Today's Posts Mark Forums Read

Reply
 
Mod Options
Cron job for Files Backup (attachments, avatars, etc.) Details »
Cron job for Files Backup (attachments, avatars, etc.)
Mod Version: 1.0.2, by Lynne (Coder/Designer) Lynne is offline
Developer Last Online: Aug 2019 I like it Show Printable Version Email this Page

This modification is in the archives.
vB Version: 3.6.x Rating: (1 vote - 5.00 average) Installs: 13
Released: 08 Mar 2008 Last Update: 20 Feb 2009 Downloads: 64
Not Supported Additional Files Re-usable Code  

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 everynight (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.

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;

Download Now

Only licensed members can download files, Click Here for more information.

Screenshots

Click image for larger version

Name:	backup1.png
Views:	199
Size:	49.1 KB
ID:	76924  

Show Your Support

  • To receive notifications regarding updates -> Click to Mark as Installed.
  • If you like this modification support the author by donating.
  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Similar Mod
Mod Developer Type Replies Last Post
Administrative and Maintenance Tools Cron job for Files Backup (attachments, avatars, etc.) Lynne vBulletin 3.7 Add-ons 30 09 Nov 2009 02:16
Administrative and Maintenance Tools Site Backup (easily backup your forum files) bairy vBulletin 3.6 Add-ons 54 06 Jun 2009 17:07

Comments
  #2  
Old 08 Mar 2008, 18:01
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
Wanted to add to my post.... I actually have two copies of this script running on my board. One that I run that makes a backup of my avatars, profile pictures, and torrents. Then, one hour later, I run one that makes a backup of my attachments. I figured it might be a good idea to spread the load, so to speak, since I have about 7 GB of attachments and only 300 MB of the other files.

Last edited by Lynne; 09 Mar 2008 at 20:37.
Reply With Quote
  #3  
Old 08 Mar 2008, 21:39
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Real name: Rob
Excellent! Thank you, Lynne.
Reply With Quote
  #4  
Old 09 Mar 2008, 14:47
valdet's Avatar
valdet valdet is offline
 
Join Date: Feb 2007
Real name: Valdet
Installed and interested to see initial feedback before I use it.
Reply With Quote
  #5  
Old 09 Mar 2008, 14:50
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Real name: Rob
I've been using it and it works like a charm.
Reply With Quote
  #6  
Old 09 Mar 2008, 19:20
athlon64bit athlon64bit is offline
 
Join Date: Mar 2007
Do you intend to update this for vbulletin 3.7 when it goes gold?
It is a fantastic add-on.
Reply With Quote
  #7  
Old 09 Mar 2008, 20:33
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
Originally Posted by athlon64bit View Post
Do you intend to update this for vbulletin 3.7 when it goes gold?
It is a fantastic add-on.
I will update it for 3.7 since I will need it for my board when I upgrade to 3.7.

I'm glad you like it.

edit: Actually, I just ran the script on my 3.7 beta 2 test board and it ran just fine.

Last edited by Lynne; 09 Mar 2008 at 20:51. Reason: add info
Reply With Quote
  #8  
Old 09 Mar 2008, 20:39
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Real name: Rob
Good job, Lynne!
Reply With Quote
  #9  
Old 09 Mar 2008, 20:41
mystic10 mystic10 is offline
 
Join Date: Sep 2007
what if u want to back up ur posting data everyday..how would i add that...and so sorry for aasking such a silly question but where would my back up folder be
Reply With Quote
  #10  
Old 09 Mar 2008, 20:52
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
Originally Posted by mystic10 View Post
what if u want to back up ur posting data everyday..how would i add that...and so sorry for aasking such a silly question but where would my back up folder be
Posting data is in the database, so you would need to run a database backup cron job, which this is not. This backup script is only for the files in your folders, not for the database information.
Reply With Quote
  #11  
Old 09 Mar 2008, 21:06
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Real name: Rob
Should be easy enough to combine both scripts, though.
Reply With Quote
  #12  
Old 09 Mar 2008, 21:26
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
Originally Posted by Boofo View Post
Should be easy enough to combine both scripts, though.
Probably, however I know that I worry about server load and I like to space out the times that I run these sort of server intensive scripts. So, I would end up separating the database backup part out anyway to run it at a totally different time.
Reply With Quote
  #13  
Old 09 Mar 2008, 21:33
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Real name: Rob
I totally agree and also do it that way. I was just letting them know it CAN be done, although it is not advisable for the very reasons you stated.
Reply With Quote
  #14  
Old 31 Mar 2008, 16:42
Manhand Manhand is offline
 
Join Date: Mar 2008
Will this script work on 3.5?
__________________
Broadband Internet | Broadband Forum

Last edited by Manhand; 26 Oct 2009 at 21:13.
Reply With Quote
  #15  
Old 02 Apr 2008, 18:45
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
Originally Posted by Manhand View Post
Will this script work on 3.5?
I don't see why not. - it's very, very basic. The part I would check out is the log_cron_action and see if that function existed back then. I never ran 3.5, so I can't tell you from experience.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Mod Options

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 11:12.

Layout Options | Width: Wide Color: