How to set backup based on date?

Asked By 20 points N/A Posted on -
qa-featured

Hi guys,

How to set backup based on date? As a java web programmer developer here in our office I have to create some back up for my MySql server database system. I always do it every day before going home. How can I possibly set the backup according to date? I want to sort it accordingly by date.

 

Expecting some help, thank you.

SHARE
Best Answer by Espinoza Thor
Answered By 0 points N/A #179322

How to set backup based on date?

qa-featured

Hello,

I think you can solve your problem. You need to do a test using the following: Server OS: Fedora Core 5, MySQL Version: MySQL 5.0.22 to set backups after 15 minutes. For this example, we should use a database that was recently supplied by Netflix as part of the Netflix movie recommendation algorithm. For this example, I have two websites to solve for this problem: 1. zmanda.com/quick-mysql-backup.html   2. dev.mysql.com/doc/refman/5.1/en/mysqldump.html

Thanks.

Best Answer
Best Answer
Answered By 0 points N/A #179323

How to set backup based on date?

qa-featured

 

Hi,

Setting the date for your backup is very important since it will not only ensure that the file is in an organized manner but it will also save you time instead of doing it manually.

Since you said that you are using SQL server and assuming that you are running Windows OS, you may want to try creating a .bat file first as shown below:

@echo off

Set mySqlPath = C:Program FilesMySMySQL Server 5.5

Set dbUser=bar

Set dbPassword=backup

Set dbname=[your database filename]

Set file=%dbName%.%DATE%_-_%dbName% ^> ^%path%%file%

“my%SQLPath%binmysqldump.exe” –u %dbUser% -p%dbPassword%

–result-file=”%path%%file” %dbName%

Echo Done!

*This next step will assume that you want to run backup every night at 23:30. For this, we will use at. In case you are using Linux, it will use the command cron.

C:/>at 23:30 /every: M, T, W, Th, F, S, Su C:DataBackupScriptsMySQL-backup.bat

Added a new job with job ID = 1

To see if the script you did is working, type at as shown below:

C:>at

Hope this helps you in your query. For further questions and help, please feel free to post it here at techyv.com

 

Related Questions