Improved backup script for wildcard support

This commit is contained in:
Serghey Rodin 2014-05-07 17:03:04 +03:00
commit fe09858035

View file

@ -148,7 +148,7 @@ if [ ! -z "$WEB_SYSTEM" ] && [ "$WEB" != '*' ]; then
web_list=$(echo "$web_list" | sed -e "s/ */\ /g" -e "s/^ //") web_list=$(echo "$web_list" | sed -e "s/ */\ /g" -e "s/^ //")
i=0 i=0
set -f
for domain in $web_list; do for domain in $web_list; do
((i ++)) ((i ++))
echo -e "$(date "+%F %T") $domain" echo -e "$(date "+%F %T") $domain"
@ -207,6 +207,7 @@ if [ ! -z "$WEB_SYSTEM" ] && [ "$WEB" != '*' ]; then
fi fi
# Define exclude arguments # Define exclude arguments
set -f
fargs=() fargs=()
fargs+=(-not) fargs+=(-not)
fargs+=(-path) fargs+=(-path)
@ -235,9 +236,8 @@ if [ ! -z "$WEB_SYSTEM" ] && [ "$WEB" != '*' ]; then
# Compress archive # Compress archive
gzip -$BACKUP_GZIP $tmpdir/web/$domain/domain_data.tar gzip -$BACKUP_GZIP $tmpdir/web/$domain/domain_data.tar
done
set +f set +f
done
# Print total # Print total
if [ "$i" -eq 1 ]; then if [ "$i" -eq 1 ]; then