chonjob backup recipies
This commit is contained in:
parent
d6695501f7
commit
b3293fdf7b
4 changed files with 15 additions and 0 deletions
1
chef/cookbooks/common/files/default/backupcron.txt
Normal file
1
chef/cookbooks/common/files/default/backupcron.txt
Normal file
|
|
@ -0,0 +1 @@
|
|||
29 23 * * * exec /usr/local/app/diaspora/script/backup 2>> /tmp/backup/errors.log
|
||||
7
chef/cookbooks/common/recipes/backup.rb
Normal file
7
chef/cookbooks/common/recipes/backup.rb
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
execute "Remove Any Pervious Cronjob" do
|
||||
command "crontab -r || true"
|
||||
end
|
||||
|
||||
execute "Add the current cronjob" do
|
||||
command "crontab /usr/local/app/diaspora/chef/files/default/backupcorn.txt"
|
||||
end
|
||||
|
|
@ -2,3 +2,4 @@ include_recipe "common::iptables"
|
|||
include_recipe "common::daemontools"
|
||||
include_recipe "common::secret_token"
|
||||
include_recipe "common::splunk"
|
||||
include_recipe "common::backup"
|
||||
|
|
|
|||
6
script/backup
Executable file
6
script/backup
Executable file
|
|
@ -0,0 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
cd /usr/local/app/diaspora/
|
||||
touch /usr/local/app/diaspora/backup_start.txt
|
||||
exec /usr/local/bin/ruby /usr/local/bin/bundle exec rake backup:mongo 2>> /tmp/backup/rake.log
|
||||
touch /usr/local/app/diaspora/backup_end.txt
|
||||
Loading…
Reference in a new issue