2
0
Fork 0

various changes

main
Ducky 2022-02-23 05:41:21 +00:00
parent eec9f19f9d
commit e651421929
1 changed files with 19 additions and 7 deletions

View File

@ -96,6 +96,8 @@ function test_path() {
host="de01" host="de01"
repo="b2:zio-euc-servers" repo="b2:zio-euc-servers"
paths=()
passwd_file="" passwd_file=""
pre_script="" pre_script=""
post_script="" post_script=""
@ -108,6 +110,8 @@ else
[[ -f "$env_dir/$host.post" ]] && post_script="$env_dir/$host.post" [[ -f "$env_dir/$host.post" ]] && post_script="$env_dir/$host.post"
if [[ -f "$env_dir/$host.var" ]]; then if [[ -f "$env_dir/$host.var" ]]; then
[[ ! -z $(get_prop "$env_dir/$host.var" PATHS) ]] && \
IFS=';' read -ra services <<< "$(get_prop "$env_dir/$host.var" PATHS)"
[[ ! -z $(get_prop "$env_dir/$host.var" SERVICES) ]] && \ [[ ! -z $(get_prop "$env_dir/$host.var" SERVICES) ]] && \
IFS=';' read -ra services <<< "$(get_prop "$env_dir/$host.var" SERVICES)" IFS=';' read -ra services <<< "$(get_prop "$env_dir/$host.var" SERVICES)"
fi fi
@ -127,13 +131,20 @@ fi
say_do "Stopping services..." say_do "Stopping services..."
for service in "${services[@]}" for service in "${services[@]}"
do do
echo "systemctl stop $service" systemctl stop $service
done done
say_do "Backing up files..." say_do "Backing up files..."
backup /etc for path in "${paths[@]}"
backup /srv/store do
backup /var backup $path
done
say_do "Starting services..."
for service in "${services[@]}"
do
systemctl start $service
done
if [[ ! -z $post_script ]]; then if [[ ! -z $post_script ]]; then
say_do "Executing post-backup script..." say_do "Executing post-backup script..."
@ -141,6 +152,7 @@ if [[ ! -z $post_script ]]; then
fi fi
say_do "Removing old backups..." say_do "Removing old backups..."
forget /etc for path in "${paths[@]}"
forget /srv/store do
forget /var forget $path
done