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

12 Commits
0.4.1 ... 0.4.2

Author SHA1 Message Date
Norbert Varzariu
413ca69760 bump version to 0.4.2 2016-01-21 15:19:02 +01:00
Norbert Varzariu
c7756458f1 Merge branch 'feature/rewrite_to_use_deep_merge' 2016-01-21 15:15:12 +01:00
Norbert Varzariu
d5e4ebbb9c add backup script templates 2016-01-21 15:11:10 +01:00
Norbert Varzariu
d6ea0821c0 Merge branch 'release/0.4.1' into develop 2016-01-20 11:45:58 +01:00
Norbert Varzariu
2cccc86433 Merge branch 'release/0.4.1' 2016-01-20 11:45:41 +01:00
Norbert Varzariu
d1008c99eb add warning to README about configuration change in 0.4.0 2016-01-19 17:39:46 +01:00
Norbert Varzariu
d5d7507fa9 Merge branch 'release/0.4.0' 2016-01-19 17:38:03 +01:00
Norbert Varzariu
5f65000606 Merge branch 'develop' 2016-01-18 20:53:46 +01:00
Norbert Varzariu
fce58cf09a Merge branch 'develop' 2016-01-18 19:58:32 +01:00
Norbert Varzariu
5cccf8200d Merge branch 'release/0.3.2' 2016-01-18 19:56:18 +01:00
Norbert Varzariu
ae2083c6ee Merge branch 'develop' 2016-01-18 12:11:28 +01:00
Norbert Varzariu
8e62ff526e Merge branch 'release/0.3.1' 2016-01-18 11:23:21 +01:00
5 changed files with 46 additions and 1 deletions

View File

@@ -1,5 +1,7 @@
# rsnapshot
## NOTE: ! Configuration for backup_scripts changed with version 0.4.0 (it was pretty useless in prior versions) !
#### Table of Contents
1. [Overview](#overview)

View File

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

10
templates/misc.sh.erb Normal file
View File

@@ -0,0 +1,10 @@
#!/bin/bash
# add custom stuff here
# FIXME: remember to concat for custom stuff after the last line of the puppet generated script
<% if @osfamily == 'RedHat' -%>
ssh <%=@host-%> rpm -qa --qf='%{name},' > packages.txt
<%end-%>
#
#
#
# ++++++++++++++++++++++++++++++++++++++++++++

16
templates/mysql.sh.erb Normal file
View File

@@ -0,0 +1,16 @@
#!/bin/bash
# written by Norbert Varzariu <loomsen@gmail.com>
# This Script is triggered by rsnapshot and dumps the specified dbs on the configured host.
#
host=<%=@host%>
user=<%=@dbbackup_user%>
pass=<%=@dbbackup_password%>
dbs=( $(mysql -h "$host" -u "$user" -p"$pass" -e 'show databases' | sed '1d;/information_schema/d;/performance_schema/d') )
for db in "${dbs[@]}"; do
mysqldump --host="$host" --user="$user" --password="$pass" --single-transaction --quick --routines --ignore-table=mysql.event "$db" > "$db".sql
wait
pbzip2 -p3 "$db".sql
done

17
templates/psql.sh.erb Normal file
View File

@@ -0,0 +1,17 @@
#!/bin/bash
# written by Norbert Varzariu <loomsen@gmail.com>
# This Script is triggered by rsnapshot and dumps the specified dbs on the configured host.
#
host=<%=@host%>
user=<%=@dbbackup_user%>
pass=<%=@dbbackup_password%>
PGPASSWORD="$pass"
dbs=( $(psql -h "$host" -U "$user" -Atc "SELECT datname FROM pg_database WHERE NOT datistemplate AND datname <> 'postgres'") )
for db in "${dbs[@]}"; do
ssh -l root "$host" "pg_dump -U ${user} -Fc ${db}" > "$db".sql
wait
pbzip2 -p3 "$db".sql
done