vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Graveyard (https://vborg.vbsupport.ru/forumdisplay.php?f=224)
-   -   Administrative and Maintenance Tools - vBulletin Cron Based Database Backup (https://vborg.vbsupport.ru/showthread.php?t=231481)

djbaxter 12-06-2012 11:20 PM

Quote:

Originally Posted by LouiseWilson (Post 2388996)
You should not really be putting anything in the public_html folder for security
In your VB options

Backups Path:-
/home/yourname/backups/

create folder outside of your public_html IE backups and chmod to 777

job done

Not all servers are configured equal. :)

On some servers, the security configuration may not permit the forum software to access folders outside of the public_html folder for that domain.

smirkley 12-07-2012 03:56 PM

Paul,...all I can say is,...SWEEET !!

Started playing with this on my VPS last night and could only get it to work in a public_html directory. Got tired and shut it down and went to bed.

This morning read each and every post trying to get this to work in a non-public directory and found that "../backups/" was what worked for me (not "../../backups/") (renamed "backups to something I prefer) and now stores in non-public directory. I feel better now that nobody can get to it.

I set the timestamp to numerical day of month (d) so since I have the storage space, will allow me to keep the last 30 (or so by month) days copies of backups before they start to overwrite when the month rolls over, which I prefer. This way when I do my weekly or so downloads of backing up my files, I can capture all 30 db backups in one process and store them offsite.

edit to add - Also changed my cron time to reflect a time trigger in an area where I know someone will be trafficking my site to avoid dead times that will not trigger the backup. (only takes ~60 seconds and I lock and repair tables settings on to keep the data stable) My visitors will barely notice that 1 minute.

Tested, Locked, and Loaded.

Thank you for this solution.

Gary_Oak 12-07-2012 08:49 PM

Quote:

Originally Posted by djbaxter (Post 2388985)
What files did you put there? :confused:

The files for the backup. I put mysqlbackup.php into /public_html/vb/db/mysql and I put the cronbackup.php into /public_html/vb/db/cron (the cron folder I uploaded with the PHP file inside it, that's how I got the folder).

If it would work outside of public_html, I would use that for better security, but I don't think it would.

djbaxter 12-08-2012 12:28 AM

Quote:

Originally Posted by Gary_Oak (Post 2389176)
The files for the backup. I put mysqlbackup.php into /public_html/vb/db/mysql and I put the mysqlbackup.php into /public_html/vb/db/cron (the cron folder I uploaded with the PHP file inside it, that's how I got the folder).

If it would work outside of public_html, I would use that for better security, but I don't think it would.

Okay, that's just wrong.

mysqlbackup.php should be uploaded to {forum root}/includes/mysqlbackup.php

cronbackup.php should be uploaded to {forum root}/includes/cron/cronbackup.php

Then go to Admin CP >> Settings >> Options >> vBulletin Automatic Backup and enter the location where you want to store the backup files in there.

smirkley 12-08-2012 12:59 AM

OK, tell me this aint weird.....

I tested exclusively by triggering the cron manually, and everything worked sweet.

So since those were tests, I deleted those backup gzips that were created under test, set a time for the trigger in the cron for 6pm.

Just checked and the cron says it ran 52 minutes ago (when I looked), so I checked in my backup directory and nothing was there.

So I did a manual run of the cron, and the backup showed up like before when I tested it.

Why wont it work when it says it will automatically. I have only changed the cron trigger time.

smirkley 12-08-2012 01:02 AM

Quote:

Originally Posted by patrick91 (Post 2388411)
It works fine that path manual! But have the problem is does not autobackup!? Is there an option that needs to be enabled to let this work or something on the server that need to be enabled?

Exactly what I just discovered !!

Paul, waas sapnin' here?

Gary_Oak 12-08-2012 02:35 PM

Quote:

Originally Posted by djbaxter (Post 2389203)
Okay, that's just wrong.

mysqlbackup.php should be uploaded to {forum root}/includes/mysqlbackup.php

cronbackup.php should be uploaded to {forum root}/includes/cron/cronbackup.php

Then go to Admin CP >> Settings >> Options >> vBulletin Automatic Backup and enter the location where you want to store the backup files in there.

I did that 2 weeks ago and it didn't work. public_html/includes/mysqlbackup.php and public_html/includes/cron/cronbackup.php . If I am wrong in my assumption that public_html is the forum root, then what would the forum root be?

Edit; I also tried putting it in www/includes/mysqlbackup.php and www/includes/cron/cronbackup.php but that didn't work either.

djbaxter 12-08-2012 02:59 PM

What does "didn't work" mean? What error message did you get when you ran it manually?

If your forum is the only site on that domain, then yes it will probably be in /home/public_html/ would be the root.

But you also need to specify a folder to save the backups AND that folder needs to have write permissions (usually 777 although sometimes 666 will work).

Gary_Oak 12-08-2012 03:39 PM

I got the same error message I did at the very beginning, that the files aren't in the right place. Sorry that I didn't mention that.

Warning: include_once([path]/includes/cron) [function.include-once]: failed to open stream: Success in [path]/admincp/cronadmin.php on line 116

Warning: include_once() [function.include]: Failed opening '[path]//includes/cron' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in [path]/admincp/cronadmin.php on line 116
Done

For now it is the only site on that domain, yes.

I created a folder called AutoBackups and set it as the folder to save the backups in with the Options setting. For the Filename when you edit it under Scheduled Tasks I have /includes/cron and the permissions for AutoBackups are 777 now, just edited that.

djbaxter 12-08-2012 03:47 PM

Quote:

Originally Posted by Gary_Oak (Post 2389331)
I got the same error message I did at the very beginning, that the files aren't in the right place. Sorry that I didn't mention that.

Warning: include_once([path]/includes/cron) [function.include-once]: failed to open stream: Success in [path]/admincp/cronadmin.php on line 116

Warning: include_once() [function.include]: Failed opening '[path]//includes/cron' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in [path]/admincp/cronadmin.php on line 116
Done

For now it is the only site on that domain, yes.

I created a folder called AutoBackups and set it as the folder to save the backups in with the Options setting. For the Filename when you edit it under Scheduled Tasks I have /includes/cron and the permissions for AutoBackups are 777 now, just edited that.

In Settings, make sure the folder is specified as follows (assuming it is also in public_html):

Code:

AutoBackups/
Note: this is case sensitive.

The cron job should have been added automatically when you installed this add-on.

varname: cbu_crontask
Title: Automatic Database Backup for vBulletin
Filename: ./includes/cron/cronbackup.php
Product: Automatic Database Backup


All times are GMT. The time now is 08:59 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01695 seconds
  • Memory Usage 1,756KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (3)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete