Go Back   cPanel Forums > General Discussion > cPanel Newbies

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-30-2010, 05:14 PM
Registered User
 
Join Date: Nov 2008
Posts: 8
BMR777 is on a distinguished road
Cron Job to back up MySQL database

Hello,

I have the following command that I run via SSH and I want to run instead as a cron job:

Code:
mysqldump  --opt --single-transaction -uusername -ppassword database > /home/username/backups/file.sql
This command backs up my MySQL database file. My question is, how can I make this a cron that runs without removing the contents of file.sql? If I run this once a week will it just overwrite the file.sql file or not execute because the file already exists, unless I delete it?

Ideally I would like to have it save the file in such a way that there are multiple dump files present until I delete them, either like file1.sql, file2.sql or file_todaysdate.sql. Is there any way to set up this cron job like this?

Thanks.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-30-2010, 06:24 PM
Infopro's Avatar
Forum Moderator
 
Join Date: May 2003
Location: Pennsylvania
Posts: 3,898
Infopro is on a distinguished road
Lightbulb

At the bottom of this very thread are links to "Similar Threads" that you might find useful. One of those links is this one:
Cron job to back up SQL databases regularly
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Tags
cron job , database backup , mysql

Thread Tools
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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to back up mysql database using cron jobs? guymelef cPanel Newbies 4 02-19-2010 04:52 AM
cron job - command to backup a database ? king007 cPanel and WHM Discussions 4 08-17-2006 05:11 AM
cron job does absolutely nothing (no visible changes and no emails back to me)[moved] Vchat20 cPanel Newbies 1 10-11-2005 10:54 AM
How to Back up database and/or files by setting up a cron? Binesh cPanel and WHM Discussions 4 11-11-2004 02:14 PM
Cron job to back up SQL databases regularly JenkinsLaw cPanel and WHM Discussions 3 07-14-2004 05:14 PM


All times are GMT -5. The time now is 02:27 AM.


Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
© cPanel Inc