mirror of
https://github.com/myvesta/vesta
synced 2025-08-14 18:49:21 -07:00
Merge branch 'master' into backups
This commit is contained in:
commit
daa33140f4
641 changed files with 29438 additions and 4737 deletions
|
@ -68,8 +68,12 @@ while [ "$la" -ge "$BACKUP_LA_LIMIT" ]; do
|
|||
(( ++i))
|
||||
done
|
||||
|
||||
if [ -z "$BACKUP_TEMP" ]; then
|
||||
BACKUP_TEMP=$BACKUP
|
||||
fi
|
||||
|
||||
# Creating temporary directory
|
||||
tmpdir=$(mktemp -p /tmp -d)
|
||||
tmpdir=$(mktemp -p $BACKUP_TEMP -d)
|
||||
|
||||
if [ "$?" -ne 0 ]; then
|
||||
echo "Can't create tmp dir $tmpdir" |$SENDMAIL -s "$subj" $email $notify
|
||||
|
@ -212,6 +216,9 @@ if [ ! -z "$WEB_SYSTEM" ] && [ "$WEB" != '*' ]; then
|
|||
cp $USER_DATA/ssl/$domain.* vesta/
|
||||
fi
|
||||
|
||||
# Changin dir to documentroot
|
||||
cd $HOMEDIR/$user/web/$domain
|
||||
|
||||
# Define exclude arguments
|
||||
exlusion=$(echo -e "$WEB" |tr ',' '\n' |grep "^$domain:")
|
||||
set -f
|
||||
|
@ -220,9 +227,15 @@ if [ ! -z "$WEB_SYSTEM" ] && [ "$WEB" != '*' ]; then
|
|||
if [ ! -z "$exlusion" ]; then
|
||||
xdirs="$(echo -e "$exlusion" |tr ':' '\n' |grep -v $domain)"
|
||||
for xpath in $xdirs; do
|
||||
fargs+=(--exclude=$xpath/*)
|
||||
echo "$(date "+%F %T") excluding directory $xpath"
|
||||
msg="$msg\n$(date "+%F %T") excluding directory $xpath"
|
||||
if [ -d "$xpath" ]; then
|
||||
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
|
||||
fi
|
||||
set +f
|
||||
|
@ -388,14 +401,17 @@ if [ ! -z "$DB_SYSTEM" ] && [ "$DB" != '*' ]; then
|
|||
grep "DB='$database'" $conf > vesta/db.conf
|
||||
|
||||
dump="$tmpdir/db/$database/$database.$TYPE.sql"
|
||||
dumpgz="$tmpdir/db/$database/$database.$TYPE.sql.gz"
|
||||
grants="$tmpdir/db/$database/conf/$database.$TYPE.$DBUSER"
|
||||
case $TYPE in
|
||||
mysql) dump_mysql_database ;;
|
||||
pgsql) dump_pgsql_database ;;
|
||||
esac
|
||||
if [ ! -f "$dumpgz" ]; then
|
||||
case $TYPE in
|
||||
mysql) dump_mysql_database ;;
|
||||
pgsql) dump_pgsql_database ;;
|
||||
esac
|
||||
|
||||
# Compress dump
|
||||
gzip -$BACKUP_GZIP $dump
|
||||
# Compress dump
|
||||
gzip -$BACKUP_GZIP $dump
|
||||
fi
|
||||
done
|
||||
|
||||
# Print total
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue