Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization 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: 4008
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: 4008
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