vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Programming Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=188)
-   -   Site and mySQL backups via cron (https://vborg.vbsupport.ru/showthread.php?t=169550)

geckoz 06-01-2009 02:55 PM

Doesn't work for me ... I think you must have SAFE MODE ON but I don't want to turn it off.

Old-Git 03-09-2011 09:48 PM

The tech support guy at my hosting gave me the following info to use Cron, via Cpanel, to do a backup of my database every Sunday night at midnight.

Quote:

In order to do a backup of your database through a cron job, you can set this up in cpanel. Click on Cron Job, then select Standard or Advanced. You can select the backup frequency that you need then enter the command to backup. Here is a sample cron job:

0 0 * * 0

date=`date -I`; /usr/bin/mysqldump -uDBUSERNAME -pPASSWORD dbname > /home/CPANELUSERNAME/FILE_NAME_HOME_DIRECTORY$date.sql

This cron job will do a backup of the database every Sunday at midnight. Then it will save the backup with the current date appended to the file name.

A few notes:

-uDBUSERNAME – there should be no space between -u and DBUSERNAME, DBUSERNAME is the username of the database you are trying to backup.

-pPASSWORD – there should be no space between -p and PASSWORD, PASSWORD is the password of the database user.

dbname – this is the name of your database.

/home/CPANEL_USERNAME/BACKUP_NAME$date.sql – cpanelusername is your username to log into cpanel, and this will save the backup in your home directory (you can change it to whatever directory you want). You can call the backup whatever you wish but adding $date at the end will append the date to that backup.
I haven't tried this yet (just received it) but thought I'd offer it here for comment!

Rgds


All times are GMT. The time now is 12:38 AM.

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

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01523 seconds
  • Memory Usage 1,713KB
  • 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_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (2)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