1
0
mirror of https://github.com/krislamo/puppet-rsnapshot synced 2025-09-13 07:49:29 +00:00

22 Commits
1.0.0 ... 1.1.0

Author SHA1 Message Date
Norbert Varzariu
283ade9782 bump version 2017-04-02 10:19:18 +02:00
Norbert Varzariu
1feea03aaa removed single quotes in misc script template 2016-06-27 13:21:03 +02:00
Norbert Varzariu
a37c7f71ea Merge branch 'release/1.0.3' into develop
- fix ordering of monthday and month in cron
2016-03-29 16:17:58 +02:00
Norbert Varzariu
93be1c12ac bump version 2016-03-29 16:16:19 +02:00
Norbert Varzariu
ea87bf924a Merge pull request #1 from nerdlich/patch-1
Correct order of monthday/month
2016-03-28 13:36:54 +02:00
nerdlich
c79d1c7fc6 Correct order of monthday/month 2016-03-24 22:53:52 +01:00
Norbert Varzariu
98519a8ebc Merge branch 'develop' 2016-01-26 08:29:52 +01:00
Norbert Varzariu
a386a710b7 quote psql password in scripts 2016-01-26 08:29:42 +01:00
Norbert Varzariu
0c5afff356 Merge branch 'release/1.0.2' into develop 2016-01-25 09:48:38 +01:00
Norbert Varzariu
3c9357f3fe Merge branch 'release/1.0.2'
- Update README
2016-01-25 09:48:18 +01:00
Norbert Varzariu
0618f0fff3 bump verison to 1.0.2 2016-01-25 09:47:57 +01:00
Norbert Varzariu
5d82b82757 update README 2016-01-25 09:47:05 +01:00
Norbert Varzariu
0e80853628 Merge branch 'release/1.0.1' into develop 2016-01-25 09:41:26 +01:00
Norbert Varzariu
1fe21e5bba Merge branch 'release/1.0.1'
- small fixes to psql backup script
2016-01-25 09:41:03 +01:00
Norbert Varzariu
08cc0037b1 bump version to 1.0.1 2016-01-25 09:40:58 +01:00
Norbert Varzariu
b3ab06b63c add postgres to psql.ignore_dbs 2016-01-25 09:40:05 +01:00
Norbert Varzariu
d252ac64a0 move PGPASSWD variable into ssh command (so it is available on the node) 2016-01-25 08:56:04 +01:00
Norbert Varzariu
8dd6298c56 Merge branch 'master' into develop 2016-01-25 08:55:20 +01:00
Norbert Varzariu
343d12c61b Merge branch 'release/1.0.0' into develop 2016-01-22 16:06:35 +01:00
Norbert Varzariu
8817ed33ff Merge branch 'release/1.0.0'
- parameterized nearly all aspects of the script
- complete documentation with examples
- configurable database backup scripts
- configurable custom commands script
- configurable mailto for crons
- and much more
2016-01-22 16:03:49 +01:00
Norbert Varzariu
12b11a6a43 Merge branch 'release/0.5.2'
- Update documentation
2016-01-22 10:42:55 +01:00
Norbert Varzariu
dcd5f532a9 Merge branch 'hotfix/update_docs'
- Update README to reflect changes in configuration of backup_scripts
- Add example backup_scripts to README
2016-01-22 10:40:41 +01:00
7 changed files with 7 additions and 10 deletions

View File

@@ -436,7 +436,7 @@ Default is:
dbbackup_password => '', dbbackup_password => '',
dumper => 'pg_dump', dumper => 'pg_dump',
dump_flags => '-Fc', dump_flags => '-Fc',
ignore_dbs => [], ignore_dbs => [ 'postgres' ],
}, },
misc => { misc => {
commands => $::osfamily ? { commands => $::osfamily ? {

View File

@@ -111,7 +111,7 @@ class rsnapshot::params {
dbbackup_password => '', dbbackup_password => '',
dumper => 'pg_dump', dumper => 'pg_dump',
dump_flags => '-Fc', dump_flags => '-Fc',
ignore_dbs => [], ignore_dbs => [ 'postgres' ],
compress => 'pbzip2', compress => 'pbzip2',
}, },
misc => { misc => {

View File

@@ -1,6 +1,6 @@
{ {
"name": "loomsen-rsnapshot", "name": "loomsen-rsnapshot",
"version": "1.0.0", "version": "1.1.0",
"author": "loomsen", "author": "loomsen",
"summary": "Configures rsnapshot.", "summary": "Configures rsnapshot.",
"license": "Apache-2.0", "license": "Apache-2.0",

View File

@@ -1 +1 @@
<%= @minute %> <%= @hour %> <%= @month %> <%= @monthday %> <%= @weekday %> root /usr/bin/rsnapshot -c <%= @config %> <%= @level %> <%= @minute %> <%= @hour %> <%= @monthday %> <%= @month %> <%= @weekday %> root /usr/bin/rsnapshot -c <%= @config %> <%= @level %>

View File

@@ -2,6 +2,6 @@
#This file is managed by puppet #This file is managed by puppet
# #
<%@commands.each do |command| -%> <%@commands.each do |command| -%>
ssh -l <%=@backup_user-%> <%=@host-%> '<%=command-%>' ssh -l <%=@backup_user-%> <%=@host-%> <%=command-%>
<%end-%> <%end-%>

View File

@@ -5,7 +5,6 @@
# #
host=<%=@host%> host=<%=@host%>
user=<%=@dbbackup_user%> user=<%=@dbbackup_user%>
pass=<%=@dbbackup_password%>
<% if (@dbbackup_user == 'root' && @dbbackup_password == '') -%> <% if (@dbbackup_user == 'root' && @dbbackup_password == '') -%>
dbs=( dbs=(

View File

@@ -5,14 +5,12 @@
# #
host=<%=@host%> host=<%=@host%>
user=<%=@dbbackup_user%> user=<%=@dbbackup_user%>
pass=<%=@dbbackup_password%>
PGPASSWORD="$pass"
dbs=( dbs=(
$(ssh -l <%=@backup_user-%> "$host" "psql -U ${user} -Atc \"SELECT datname FROM pg_database WHERE NOT datistemplate AND NOT datname ~ '<%@ignore_dbs.each do |db|-%><%if db == @ignore_dbs.last-%><%=db-%><%else-%><%=db-%>|<%end-%><%end-%>'\"") $(ssh -l <%=@backup_user-%> "$host" "PGPASSWORD='<%=@dbbackup_password%>' psql -U ${user} -Atc \"SELECT datname FROM pg_database WHERE NOT datistemplate AND NOT datname ~ '<%@ignore_dbs.each do |db|-%><%if db == @ignore_dbs.last-%><%=db-%><%else-%><%=db-%>|<%end-%><%end-%>'\"")
) )
for db in "${dbs[@]}"; do for db in "${dbs[@]}"; do
ssh -l <%=@backup_user-%> "$host" "<%=@dumper-%> -U ${user} <%=@dump_flags-%> ${db}" > "$db".sql ssh -l <%=@backup_user-%> "$host" "PGPASSWORD='<%=@dbbackup_password%>' <%=@dumper-%> -U ${user} <%=@dump_flags-%> ${db}" > "$db".sql
wait wait
<% if @compress != '' -%> <% if @compress != '' -%>
<%=@compress-%> "$db".sql <%=@compress-%> "$db".sql