toy / dump

Rails app rake and capistrano tasks to create and restore dumps of database and assets
MIT License
89 stars 14 forks source link

Dump file path #20

Closed sohail-khalil closed 8 years ago

sohail-khalil commented 8 years ago

Is there any way to specify the dump path? Currently it is in "dump/" . I want to change the path.

toy commented 8 years ago

Currently it is hardcoded, so not without changing code. Seems there are two places (outside of specs): https://github.com/toy/dump/blob/master/lib/dump.rb#L43 and https://github.com/toy/dump/blob/master/lib/dump/snapshot.rb#L12

sohail-khalil commented 8 years ago

Thanks toy.

I change the dump path by overriding the create method in dump.rb

def create(options = {}) setting = Setting.first dump = Snapshot.new(options.merge(:dir => File.join(rails_root, setting.backup_path))) Writer.create(dump.tmp_path) File.rename(dump.tmp_path, dump.tgz_path) puts File.basename(dump.tgz_path) end