From 96416c4a8fb9c22f4273160672e72fc68e2317d9 Mon Sep 17 00:00:00 2001 From: Lucas Severo Date: Tue, 12 Jan 2016 17:07:28 -0200 Subject: [PATCH] add config variable for dev_backup --- config/lappis/config.yaml | 3 ++- cookbooks/backup/templates/rsnapshot-spb.erb | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/config/lappis/config.yaml b/config/lappis/config.yaml index ba38850..68dc627 100644 --- a/config/lappis/config.yaml +++ b/config/lappis/config.yaml @@ -13,4 +13,5 @@ relay_hostname: relay.softwarepublico.lappis relay_ip: 10.0.0.15 alt_ssh_port: 5555 from_address: noreply@softwarepublico.lappis - +# define less frequent backup for dev envs +dev_backup: true diff --git a/cookbooks/backup/templates/rsnapshot-spb.erb b/cookbooks/backup/templates/rsnapshot-spb.erb index 6574de3..54fdd86 100644 --- a/cookbooks/backup/templates/rsnapshot-spb.erb +++ b/cookbooks/backup/templates/rsnapshot-spb.erb @@ -1,8 +1,8 @@ -<%if node['environment'] == 'prod'%> +<%if node['config']['dev_backup']%> +20 23 1 * * root rsnapshot monthly +<%else%> 0 */6 * * * root rsnapshot hourly 59 23 * * * root rsnapshot daily 40 23 * * 7 root rsnapshot weekly 20 23 1 * * root rsnapshot monthly -<%else%> -20 23 1 * * root rsnapshot monthly <%end%> -- libgit2 0.21.2