[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,9 +1,12 @@
#!/bin/bash #!/bin/bash
# Exit hook on subcommand error or unset variable
set -eu set -eu
# Source YNH helpers
. /usr/share/yunohost/helpers.d/filesystem . /usr/share/yunohost/helpers.d/filesystem
# Backup destination
backup_dir="${1}/conf/ldap" backup_dir="${1}/conf/ldap"
# Backup the configuration # Backup the configuration

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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