TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 02-20-2013, 08:33 AM   #1 (permalink)
The Visitor
Newcomer 
 
Join Date: Jan 2013
Posts: 3
Thanks: 0
xy8797 is on a distinguished road
Default How to backup mysql with cron?

How to backup mysql with cron?(I am a new.)
__________________
pandora charms
pandora canada
xy8797 is offline  
Reply With Quote
Old 02-21-2013, 07:56 AM   #2 (permalink)
The Wanderer
 
nancy30's Avatar
 
Join Date: Feb 2013
Location: London
Posts: 8
Thanks: 1
nancy30 is on a distinguished road
Default

Create a shell script and save it somewhere like /root/mysqlbackup.sh, because it will contain your mysql password so needs to be kept safe.

Code:
#!/bin/sh

DAY=`/bin/date +%Y%m%d`
mysqldump DATABASE -u USERNAME -pPASSWORD > /path/mysql.yourdomain.$DAY.sql

and do

chown root:root /root/mysqlbackup.sh
chmod +x /root/mysqlbackup.sh
Then set this to be executable as a cron job. Job done!
nancy30 is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Using a MySQL class Andrew General 12 07-14-2009 03:49 PM
MySQL Sell Up Alan @ CIT The Lounge 12 01-17-2008 05:46 PM
Error in connecting to MySQL via PHP EyeDentify MySQL & Databases 0 01-03-2008 01:06 PM
Export as SQL from mySQL using cron job datahound MySQL & Databases 5 12-08-2007 12:18 AM
Notepage like application to open large MySQL files Wildhoney General 6 12-07-2007 02:18 PM


All times are GMT. The time now is 04:33 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design