[enh] Comments will save us.

This commit is contained in:
opi 2016-05-30 09:17:25 +02:00
parent 048ed3b0ea
commit 75b9cbc7f3
12 changed files with 54 additions and 4 deletions

View file

@ -1,14 +1,17 @@
#!/bin/bash
# Exit hook on subcommand error or unset variable
set -eu
# Source YNH helpers
. /usr/share/yunohost/helpers.d/filesystem
# Backup destination
backup_dir="${1}/conf/ldap"
# Back up the configuration
# Backup the configuration
ynh_backup "/etc/ldap/slapd.conf" "${backup_dir}/slapd.conf"
sudo slapcat -b cn=config -l "${backup_dir}/cn=config.master.ldif"
# Back up the database
# Backup the database
sudo slapcat -b dc=yunohost,dc=org -l "${backup_dir}/dc=yunohost-dc=org.ldif"

View file

@ -1,11 +1,15 @@
#!/bin/bash
# Exit hook on subcommand error or unset variable
set -eu
# Source YNH helpers
. /usr/share/yunohost/helpers.d/filesystem
# Backup destination
backup_dir="${1}/conf/ssh"
# Backup the configuration
if [ -d /etc/ssh/ ]; then
ynh_backup "/etc/ssh" "$backup_dir"
else

View file

@ -1,9 +1,12 @@
#!/bin/bash
# Exit hook on subcommand error or unset variable
set -eu
# Source YNH helpers
. /usr/share/yunohost/helpers.d/filesystem
# Backup destination
backup_dir="${1}/conf/ynh/mysql"
# Save MySQL root password

View file

@ -1,9 +1,13 @@
#!/bin/bash
# Exit hook on subcommand error or unset variable
set -eu
# Source YNH helpers
. /usr/share/yunohost/helpers.d/filesystem
# Backup destination
backup_dir="${1}/conf/ssowat"
# Backup the configuration
ynh_backup "/etc/ssowat" "$backup_dir"

View file

@ -1,11 +1,17 @@
#!/bin/bash
# Exit hook on subcommand error or unset variable
set -eu
# Source YNH helpers
. /usr/share/yunohost/helpers.d/filesystem
# Backup destination
backup_dir="${1}/data/home"
# Backup user home
for f in $(find /home/* -type d -prune | awk -F/ '{print $NF}'); do
if [[ ! "$f" =~ ^yunohost|lost\+found ]]; then
ynh_backup "/home/$f" "${1}/data/home/$f" 1
ynh_backup "/home/$f" "${backup_dir}/$f" 1
fi
done

View file

@ -1,9 +1,13 @@
#!/bin/bash
# Exit hook on subcommand error or unset variable
set -eu
# Source YNH helpers
. /usr/share/yunohost/helpers.d/filesystem
# Backup destination
backup_dir="${1}/conf/ynh/firewall"
# Backup the configuration
ynh_backup "/etc/yunohost/firewall.yml" "${backup_dir}/firewall.yml"

View file

@ -1,9 +1,13 @@
#!/bin/bash
# Exit hook on subcommand error or unset variable
set -eu
# Source YNH helpers
. /usr/share/yunohost/helpers.d/filesystem
# Backup destination
backup_dir="${1}/conf/ynh/certs"
# Backup certificates
ynh_backup "/etc/yunohost/certs" "$backup_dir"

View file

@ -1,7 +1,13 @@
#!/bin/bash
# Exit hook on subcommand error or unset variable
set -eu
# Source YNH helpers
. /usr/share/yunohost/helpers.d/filesystem
ynh_backup /var/mail "${1}/data/mail" 1
# Backup destination
backup_dir="${1}/data/mail"
# Backup mails
ynh_backup /var/mail "$backup_dir" 1

View file

@ -1,10 +1,14 @@
#!/bin/bash
# Exit hook on subcommand error or unset variable
set -eu
# Source YNH helpers
. /usr/share/yunohost/helpers.d/filesystem
# Backup destination
backup_dir="${1}/conf/xmpp"
# Backup the configuration
ynh_backup /etc/metronome "${backup_dir}/etc"
ynh_backup /var/lib/metronome "${backup_dir}/var"

View file

@ -1,9 +1,13 @@
#!/bin/bash
# Exit hook on subcommand error or unset variable
set -eu
# Source YNH helpers
. /usr/share/yunohost/helpers.d/filesystem
# Backup destination
backup_dir="${1}/conf/nginx"
# Backup the configuration
ynh_backup "/etc/nginx/conf.d" "$backup_dir"

View file

@ -1,11 +1,15 @@
#!/bin/bash
# Exit hook on subcommand error or unset variable
set -eu
# Source YNH helpers
. /usr/share/yunohost/helpers.d/filesystem
# Backup destination
backup_dir="${1}/conf/cron"
# Backup the configuration
for f in $(ls -1B /etc/cron.d/yunohost*); do
ynh_backup "$f" "${backup_dir}/${f##*/}"
done

View file

@ -1,9 +1,13 @@
#!/bin/bash
# Exit hook on subcommand error or unset variable
set -eu
# Source YNH helpers
. /usr/share/yunohost/helpers.d/filesystem
# Backup destination
backup_dir="${1}/conf/ynh"
# Backup the configuration
ynh_backup "/etc/yunohost/current_host" "${backup_dir}/current_host"