Hi, I want to backup and restore my database using Ruby code. Does any one can give an idea of how to do this. My requirement is the Admin who is logged in to the application should be able to create a backup of the database available. How can i do this. Thanks Jagan --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hi, 2007/10/23, Jagan <jaganmohan.jasti@gmail.com>:> > > Hi, > > I want to backup and restore my database using Ruby code.Does any one can give an idea of how to do this. You can use "mysqldump" [1] console program for database backup. (execute it with right arguments) For import you can use "mysqlimport" [2]. My requirement is the Admin who is logged in to the application> should be able to create a backup of the database available.When click to backup button, you execute mysqldump program to backup and save file to "public/backups/#{date....}". It is better you save some information about backup to "backups" table. For import, list files in "public/backups" (if you use "backups" table it is easier to list records). When selected some file, you send it to mysqlimport as a argument. Links: [1] http://dev.mysql.com/doc/refman/5.0/en/mysqldump.html [2] http://dev.mysql.com/doc/refman/5.0/en/mysqlimport.html Regards, Murat -- - - - - - - - - - - - - - - - - - - - - - - Murat Ârif ÇELİKER < http://www.ikinoktayazilim.com/wordpress > İkinokta Yazılım, Bursa http://www.ikinoktayazilim.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 10/23/07, Murat Arif ÇELİKER <murat.celiker@gmail.com> wrote:> Hi, > > 2007/10/23, Jagan <jaganmohan.jasti@gmail.com>: > > > > Hi, > > > > I want to backup and restore my database using Ruby code. > > > Does any one can give an idea of how to do this. > > You can use "mysqldump" [1] console program for database backup. (execute it > with right arguments) > For import you can use "mysqlimport" [2].Since this seems to be for an online 'hot' backup. Careful attention needs to be paid to getting a consistent backup in the face of concurrency. I think that this means a little study of the implications of options like: --lock-tables --lock-all-tables and --single-transaction on mysqldump. Note also that things change depending on wheter the table is InnoDB, MyIsam or whatever. -- Rick DeNatale My blog on Ruby http://talklikeaduck.denhaven2.com/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---