aspose file tools*
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
Author

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
author
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3716
    
    5

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.


S.D. MADHAN
Not many get the right opportunity !
Scott Selikoff
author
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3716
    
    5

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Taking backuop in Every miniute