mirror of
https://github.com/myvesta/vesta
synced 2025-08-19 21:04:07 -07:00
Merge pull request #1887 from Myself5/master
v-backup-user: Properly fix userdata backup exclusions
This commit is contained in:
commit
58e9615d94
1 changed files with 9 additions and 5 deletions
|
@ -460,11 +460,15 @@ if [ "$USER" != '*' ]; then
|
||||||
fi
|
fi
|
||||||
fargs=()
|
fargs=()
|
||||||
for xpath in $(echo "$USER" |tr ',' '\n'); do
|
for xpath in $(echo "$USER" |tr ',' '\n'); do
|
||||||
fargs+=(-not)
|
if [ -d "$xpath" ]; then
|
||||||
fargs+=(-path)
|
fargs+=(--exclude=$xpath/*)
|
||||||
fargs+=("./$xpath*")
|
echo "$(date "+%F %T") excluding directory $xpath" |\
|
||||||
echo "$(date "+%F %T") excluding directory $xpath" |\
|
|
||||||
tee -a $BACKUP/$user.log
|
tee -a $BACKUP/$user.log
|
||||||
|
else
|
||||||
|
echo "$(date "+%F %T") excluding file $xpath" |\
|
||||||
|
tee -a $BACKUP/$user.log
|
||||||
|
fargs+=(--exclude=$xpath)
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
IFS=$'\n'
|
IFS=$'\n'
|
||||||
|
@ -479,7 +483,7 @@ if [ "$USER" != '*' ]; then
|
||||||
echo -e "$(date "+%F %T") adding $udir" |tee -a $BACKUP/$user.log
|
echo -e "$(date "+%F %T") adding $udir" |tee -a $BACKUP/$user.log
|
||||||
|
|
||||||
# Backup files and dirs
|
# Backup files and dirs
|
||||||
tar -cpf- $udir |gzip -$BACKUP_GZIP - > $tmpdir/user_dir/$udir.tar.gz
|
tar --anchored -cpf- ${fargs[@]} $udir |gzip -$BACKUP_GZIP - > $tmpdir/user_dir/$udir.tar.gz
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
set +f
|
set +f
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue