Merge branch 'stable' into unstable
continuous-integration/drone/push Build was killed Details

This commit is contained in:
Jérémy Lecour 2022-01-31 11:56:10 +01:00 committed by Jérémy Lecour
commit cd4822488c
3 changed files with 19 additions and 7 deletions

View File

@ -14,8 +14,12 @@ The **patch** part changes is incremented if multiple releases happen the same m
### Changed
* rbenv: install Ruby 3.1.0 by default
* evolinux-base: backup-server-state: add "force" mode
### Fixed
* evolinux-base: backup-server-state: fix systemctl invocation
### Removed
### Security

View File

@ -2,7 +2,7 @@
PROGNAME="backup-server-state"
VERSION="22.01.2"
VERSION="22.01.3"
readonly VERSION
backup_dir=
@ -14,7 +14,7 @@ show_version() {
cat <<END
${PROGNAME} version ${VERSION}
Copyright 2018-2021 Evolix <info@evolix.fr>,
Copyright 2018-2022 Evolix <info@evolix.fr>,
Jérémy Lecour <jlecour@evolix.fr>
and others.
@ -31,6 +31,7 @@ Usage: ${PROGNAME} --backup-dir=/path/to/backup/directory [OPTIONS]
Options
-d, --backup-dir path to the directory where the backup will be stored
-f, --force keep existing backup directory and its content
--etc backup copy of /etc
--no-etc no backup copy of /etc (default)
--dpkg backup copy of /var/lib/dpkg
@ -680,7 +681,7 @@ backup_systemctl() {
systemctl_bin=$(command -v systemctl)
if [ -n "${systemctl_bin}" ]; then
last_result=$(${systemctl_bin} systemctl --no-legend --state=failed --type=service > "${backup_dir}/systemctl-failed-services.txt")
last_result=$(${systemctl_bin} --no-legend --state=failed --type=service > "${backup_dir}/systemctl-failed-services.txt")
last_rc=$?
if [ ${last_rc} -eq 0 ]; then
@ -703,8 +704,10 @@ main() {
fi
if [ -d "${backup_dir}" ]; then
echo "ERROR: The backup directory ${backup_dir} already exists. Delete it first." >&2
exit 2
if [ "${FORCE}" != "1" ]; then
echo "ERROR: The backup directory ${backup_dir} already exists. Delete it first." >&2
exit 2
fi
else
create_backup_dir
fi
@ -794,6 +797,10 @@ while :; do
VERBOSE=1
;;
-f|--force)
FORCE=1
;;
-d|--backup-dir)
# with value separated by space
if [ -n "$2" ]; then
@ -982,6 +989,7 @@ done
# Default values
: "${VERBOSE:=0}"
: "${FORCE:=0}"
: "${DO_ETC:=0}"
: "${DO_DPKG_FULL:=0}"
: "${DO_DPKG_STATUS:=1}"

View File

@ -1,6 +1,6 @@
---
rbenv_version: v1.1.2
rbenv_ruby_version: 2.7.0
rbenv_version: v1.2.0
rbenv_ruby_version: 3.1.0
rbenv_root: "~/.rbenv"
rbenv_repo: "https://github.com/rbenv/rbenv.git"
rbenv_plugins: