mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-08-19 21:04:06 -07:00
fix backup exlustions for files
This commit is contained in:
parent
2044890bae
commit
0437c4ac3e
1 changed files with 13 additions and 4 deletions
|
@ -216,6 +216,9 @@ if [ ! -z "$WEB_SYSTEM" ] && [ "$WEB" != '*' ]; then
|
||||||
cp $USER_DATA/ssl/$domain.* vesta/
|
cp $USER_DATA/ssl/$domain.* vesta/
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Changin dir to documentroot
|
||||||
|
cd $HOMEDIR/$user/web/$domain
|
||||||
|
|
||||||
# Define exclude arguments
|
# Define exclude arguments
|
||||||
exlusion=$(echo -e "$WEB" |tr ',' '\n' |grep "^$domain:")
|
exlusion=$(echo -e "$WEB" |tr ',' '\n' |grep "^$domain:")
|
||||||
set -f
|
set -f
|
||||||
|
@ -224,15 +227,21 @@ if [ ! -z "$WEB_SYSTEM" ] && [ "$WEB" != '*' ]; then
|
||||||
if [ ! -z "$exlusion" ]; then
|
if [ ! -z "$exlusion" ]; then
|
||||||
xdirs="$(echo -e "$exlusion" |tr ':' '\n' |grep -v $domain)"
|
xdirs="$(echo -e "$exlusion" |tr ':' '\n' |grep -v $domain)"
|
||||||
for xpath in $xdirs; do
|
for xpath in $xdirs; do
|
||||||
fargs+=(--exclude=$xpath/*)
|
for xpath in $xdirs; do
|
||||||
echo "$(date "+%F %T") excluding directory $xpath"
|
if [ -d "$xpath" ]; then
|
||||||
msg="$msg\n$(date "+%F %T") excluding directory $xpath"
|
fargs+=(--exclude=$xpath/*)
|
||||||
|
echo "$(date "+%F %T") excluding directory $xpath"
|
||||||
|
msg="$msg\n$(date "+%F %T") excluding directory $xpath"
|
||||||
|
else
|
||||||
|
echo "$(date "+%F %T") excluding file $xpath"
|
||||||
|
msg="$msg\n$(date "+%F %T") excluding file $xpath"
|
||||||
|
fargs+=(--exclude=$xpath)
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
set +f
|
set +f
|
||||||
|
|
||||||
# Backup files
|
# Backup files
|
||||||
cd $HOMEDIR/$user/web/$domain
|
|
||||||
tar -cpf- * ${fargs[@]} |gzip -$BACKUP_GZIP - > $tmpdir/web/$domain/domain_data.tar.gz
|
tar -cpf- * ${fargs[@]} |gzip -$BACKUP_GZIP - > $tmpdir/web/$domain/domain_data.tar.gz
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue