Pour tout problème contactez-nous par mail : support@froggit.fr | La FAQ :grey_question: | Rejoignez-nous sur le Chat :speech_balloon:

Skip to content
Snippets Groups Projects
Commit 3728d872 authored by Arthur BOUDREAULT's avatar Arthur BOUDREAULT
Browse files

add default vars for backup script

parent 15b593f5
No related branches found
No related tags found
No related merge requests found
Pipeline #7443 passed with warnings
#!/bin/bash
today="$(date +%Y%m%d)"
number_to_keep="{{ number_days_to_keep }}"
old_backup_list="$(yunohost backup list --output-as plain | head -n -"$number_to_keep")" # Afficher toutes les lignes de sauvegardes à part les deux dernières.
old_backup_list="$(yunohost backup list --output-as plain | head -n -"$number_to_keep")"
_good() {
echo "SUCCESS: ${1}" && exit 0
......@@ -13,7 +13,7 @@ _fail() {
_create_ynh_backup() {
echo "Backing up $today YunoHost data now."
yunohost backup create {% if ynh_backup.system %}--system{% endif %}{% if ynh_backup.apps %} --apps{% endif %}{% if ynh_backup.directory %} --output-directory {{ ynh_backup.directory }}/backup_"$today" {% endif %} || _fail "can't create a backup"
yunohost backup create {% if ynh_backup.system|default(ynh_backup.system == true) %}--system{% endif %}{% if ynh_backup.apps|default(ynh_backup.apps == true) %} --apps{% endif %}{% if ynh_backup.directory|default(ynh_backup.directory == "/data/backup") %} --output-directory {{ ynh_backup.directory }}/backup_"$today" {% endif %} || _fail "can't create a backup"
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment