wood burning stoves 2.0*
The moose likes JDBC and the fly likes Taking backuop in Every miniute Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Taking backuop in Every miniute" Watch "Taking backuop in Every miniute" New topic

Taking backuop in Every miniute

Kasun Wixkramanayake
Ranch Hand

Joined: Feb 09, 2010
Posts: 74
I need To get a MYSql database backup automatically and need to Save it in a Folder in every minute
Scott Selikoff
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3703

Is your database especially small? If not, backing it up directly can take longer than a minute and may slow down performance. I would suggest a MySQL replication pattern.

My Blog: Down Home Country Coding with Scott Selikoff
Madhan Sundararajan Devaki
Ranch Hand

Joined: Mar 18, 2011
Posts: 312

Write a simple batch/shell-script that will copy the database file into your required location with timestamp prefixed to the file name. Schedule the batch/shell-script to be executed for the frequency you desire.

Not many get the right opportunity !
Scott Selikoff
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3703

That overlooks the issue that running a backup every 1 minute would seriously hurt performance on a database. Scheduling a script to run a backup is fine, but every 1 minute would have serious consequences. This is one of those situations where there is a mismatch between the problem being solved and the proposed solution, namely that keeping a database in sync should not involve spamming backups but instead should rely on a replication pattern.
It is sorta covered in the JavaRanch Style Guide.
subject: Taking backuop in Every miniute
Similar Threads
Jpanel not displayed
Ecofriendly: I fail again
How to Ask Questions the Smart Way
How to: Spring using Hibernate