mirror of
https://github.com/myvesta/vesta
synced 2025-08-14 10:37:42 -07:00
Update v-backup-user
Include "hidden" files to backup with support for exclusions in old pattern
This commit is contained in:
parent
0dda04a19f
commit
47d55cff76
1 changed files with 6 additions and 1 deletions
|
@ -251,6 +251,11 @@ if [ ! -z "$WEB_SYSTEM" ] && [ "$WEB" != '*' ]; then
|
|||
if [ ! -z "$exlusion" ]; then
|
||||
xdirs="$(echo -e "$exlusion" |tr ':' '\n' |grep -v $domain)"
|
||||
for xpath in $xdirs; do
|
||||
# Add ./ at the beginning of the path if the path is in old pattern
|
||||
if [[ $xpath != ./* ]]; then
|
||||
xpath=(./$xpath)
|
||||
fi
|
||||
|
||||
if [ -d "$xpath" ]; then
|
||||
fargs+=(--exclude=$xpath/*)
|
||||
echo "$(date "+%F %T") excluding directory $xpath"
|
||||
|
@ -265,7 +270,7 @@ if [ ! -z "$WEB_SYSTEM" ] && [ "$WEB" != '*' ]; then
|
|||
set +f
|
||||
|
||||
# Backup files
|
||||
tar --anchored -cpf- ${fargs[@]} * |gzip -$BACKUP_GZIP - > $tmpdir/web/$domain/domain_data.tar.gz
|
||||
tar --anchored -cpf- ${fargs[@]} --exclude={'./','../'} . |gzip -$BACKUP_GZIP - > $tmpdir/web/$domain/domain_data.tar.gz
|
||||
done
|
||||
|
||||
# Print total
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue