This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Taking backuop in Every miniute

 
Kasun Wixkramanayake
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4020
18
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Madhan Sundararajan Devaki
Ranch Hand
Posts: 312
Java MS IE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Scott Selikoff
author
Saloon Keeper
Posts: 4020
18
Eclipse IDE Flex Google Web Toolkit
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic