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