mirror of
https://github.com/myvesta/vesta
synced 2025-08-19 21:04:07 -07:00
Adding call for function wait_for_backup_if_it_is_not_time_for_backup
This commit is contained in:
parent
525bd0f162
commit
4814e7a28e
1 changed files with 6 additions and 16 deletions
|
@ -39,22 +39,7 @@ is_backup_enabled
|
||||||
# Action #
|
# Action #
|
||||||
#----------------------------------------------------------#
|
#----------------------------------------------------------#
|
||||||
|
|
||||||
# block backup if current hour is after 6 AM
|
wait_for_backup_if_it_is_not_time_for_backup
|
||||||
WAIT_LOOP_ENTERED=0
|
|
||||||
if pgrep -x "v-backup-users" > /dev/null
|
|
||||||
then
|
|
||||||
hour=$(date +"%H");
|
|
||||||
while [ "$hour" -gt "6" ]; do
|
|
||||||
if [ "$WAIT_LOOP_ENTERED" -eq 0 ]; then
|
|
||||||
$BIN/v-restart-web-backend
|
|
||||||
fi
|
|
||||||
WAIT_LOOP_ENTERED=1
|
|
||||||
current_date_time="`date "+%Y-%m-%d %H:%M:%S"`";
|
|
||||||
echo "$current_date_time - wait for backup user $user - hour $hour";
|
|
||||||
sleep 300
|
|
||||||
hour=$(date +"%H");
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Set backup directory if undefined
|
# Set backup directory if undefined
|
||||||
if [ -z "$BACKUP" ]; then
|
if [ -z "$BACKUP" ]; then
|
||||||
|
@ -153,6 +138,7 @@ if [ ! -z "$WEB_SYSTEM" ] && [ "$WEB" != '*' ]; then
|
||||||
i=0
|
i=0
|
||||||
|
|
||||||
for domain in $web_list; do
|
for domain in $web_list; do
|
||||||
|
wait_for_backup_if_it_is_not_time_for_backup
|
||||||
((i ++))
|
((i ++))
|
||||||
echo -e "$(date "+%F %T") $domain" |tee -a $BACKUP/$user.log
|
echo -e "$(date "+%F %T") $domain" |tee -a $BACKUP/$user.log
|
||||||
mkdir -p $tmpdir/web/$domain/conf
|
mkdir -p $tmpdir/web/$domain/conf
|
||||||
|
@ -326,6 +312,7 @@ if [ ! -z "$MAIL_SYSTEM" ] && [ "$MAIL" != '*' ]; then
|
||||||
|
|
||||||
i=0
|
i=0
|
||||||
for domain in $mail_list; do
|
for domain in $mail_list; do
|
||||||
|
wait_for_backup_if_it_is_not_time_for_backup
|
||||||
((i ++))
|
((i ++))
|
||||||
echo -e "$(date "+%F %T") $domain" |tee -a $BACKUP/$user.log
|
echo -e "$(date "+%F %T") $domain" |tee -a $BACKUP/$user.log
|
||||||
mkdir -p $tmpdir/mail/$domain/conf
|
mkdir -p $tmpdir/mail/$domain/conf
|
||||||
|
@ -398,6 +385,7 @@ if [ ! -z "$DB_SYSTEM" ] && [ "$DB" != '*' ]; then
|
||||||
conf="$USER_DATA/db.conf"
|
conf="$USER_DATA/db.conf"
|
||||||
db_list=$(echo "$db_list" |sed -e "s/ */\ /g" -e "s/^ //")
|
db_list=$(echo "$db_list" |sed -e "s/ */\ /g" -e "s/^ //")
|
||||||
for database in $db_list; do
|
for database in $db_list; do
|
||||||
|
wait_for_backup_if_it_is_not_time_for_backup
|
||||||
((i ++))
|
((i ++))
|
||||||
get_database_values
|
get_database_values
|
||||||
|
|
||||||
|
@ -500,6 +488,8 @@ if [ "$USER" != '*' ]; then
|
||||||
udir_list="$udir_list $udir"
|
udir_list="$udir_list $udir"
|
||||||
echo -e "$(date "+%F %T") adding $udir" |tee -a $BACKUP/$user.log
|
echo -e "$(date "+%F %T") adding $udir" |tee -a $BACKUP/$user.log
|
||||||
|
|
||||||
|
wait_for_backup_if_it_is_not_time_for_backup
|
||||||
|
|
||||||
# Backup files and dirs
|
# Backup files and dirs
|
||||||
tar -cpf- $udir |gzip -$BACKUP_GZIP - > $tmpdir/user_dir/$udir.tar.gz
|
tar -cpf- $udir |gzip -$BACKUP_GZIP - > $tmpdir/user_dir/$udir.tar.gz
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue