mirror of
https://github.com/krislamo/puppet-rsnapshot
synced 2025-09-13 07:49:29 +00:00
Compare commits
12 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
413ca69760 | ||
|
c7756458f1 | ||
|
d5e4ebbb9c | ||
|
d6ea0821c0 | ||
|
2cccc86433 | ||
|
d1008c99eb | ||
|
d5d7507fa9 | ||
|
5f65000606 | ||
|
fce58cf09a | ||
|
5cccf8200d | ||
|
ae2083c6ee | ||
|
8e62ff526e |
@@ -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)
|
||||
|
@@ -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
10
templates/misc.sh.erb
Normal 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
16
templates/mysql.sh.erb
Normal 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
17
templates/psql.sh.erb
Normal 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
|
||||
|
Reference in New Issue
Block a user