This repository has been archived by the owner on May 18, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/add_backup' into develop
- Loading branch information
Showing
6 changed files
with
99 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# encoding: utf-8 | ||
|
||
## | ||
# Backup Generated: backup | ||
# Once configured, you can run the backup with the following command: | ||
# | ||
# $ backup perform -t backup [-c <path_to_configuration_file>] | ||
# | ||
Backup::Model.new(:nastachku_staging, 'Nastachku staging backup') do | ||
|
||
database PostgreSQL do |db| | ||
db.name = "nastachku_staging" | ||
db.username = "nastachku_staging" | ||
db.password = "password" | ||
end | ||
|
||
store_with Local do |local| | ||
local.path = "/var/tmp/" | ||
local.keep = 5 | ||
end | ||
|
||
compress_with Gzip do |compression| | ||
compression.best = true | ||
compression.fast = false | ||
end | ||
|
||
end | ||
|
||
Backup::Model.new(:nastachku_production, 'Nastachku production backup') do | ||
|
||
database PostgreSQL do |db| | ||
db.name = "nastachku_production" | ||
db.username = "nastachku_production" | ||
db.password = "password" | ||
end | ||
|
||
store_with Local do |local| | ||
local.path = "/var/tmp/" | ||
local.keep = 18 | ||
end | ||
|
||
compress_with Gzip do |compression| | ||
compression.best = true | ||
compression.fast = false | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Use this file to easily define all of your cron jobs. | ||
# | ||
# It's helpful, but not entirely necessary to understand cron before proceeding. | ||
# http://en.wikipedia.org/wiki/Cron | ||
|
||
# Example: | ||
# | ||
# set :output, "/path/to/my/cron_log.log" | ||
# | ||
# every 2.hours do | ||
# command "/usr/bin/some_great_command" | ||
# runner "MyModel.some_method" | ||
# rake "some:great:rake:task" | ||
# end | ||
# | ||
# every 4.days do | ||
# runner "AnotherModel.prune_old_records" | ||
# end | ||
|
||
# Learn more: http://github.com/javan/whenever | ||
|
||
job_type :bundle_command, "cd :path && RAILS_ENV=#{environment} bundle exec :task" | ||
|
||
set :path, "/u/apps/nastachku/current" | ||
|
||
every 4.hours do | ||
bundle_command "backup perform -t nastachku_#{environment} -c config/backup.rb --root_path ." | ||
|
||
end |