mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-08-19 13:01:51 -07:00
reset bw counter on the start of the month
This commit is contained in:
parent
636213f0b6
commit
6d8ffc1ab9
3 changed files with 11 additions and 1 deletions
|
@ -65,7 +65,7 @@ TOTAL_U_CRON_JOBS=0
|
||||||
TOTAL_U_BACKUPS=0
|
TOTAL_U_BACKUPS=0
|
||||||
|
|
||||||
# Updating user stats
|
# Updating user stats
|
||||||
for user in $user_list; do
|
for user in $user_list; do
|
||||||
USER_DATA=$VESTA/data/users/$user
|
USER_DATA=$VESTA/data/users/$user
|
||||||
source $USER_DATA/user.conf
|
source $USER_DATA/user.conf
|
||||||
next_month=$(date +'%m/01/%y' -d '+ 1 month')
|
next_month=$(date +'%m/01/%y' -d '+ 1 month')
|
||||||
|
|
|
@ -61,6 +61,11 @@ echo > $log_file
|
||||||
# Vesta #
|
# Vesta #
|
||||||
#----------------------------------------------------------#
|
#----------------------------------------------------------#
|
||||||
|
|
||||||
|
# Reset counter on the start of the month
|
||||||
|
if [ "$(date +%d)" = '01' ]; then
|
||||||
|
update_object_value 'web' 'DOMAIN' "$domain" '$U_BANDWIDTH' '0'
|
||||||
|
fi
|
||||||
|
|
||||||
# Parsing old value
|
# Parsing old value
|
||||||
get_domain_values 'web'
|
get_domain_values 'web'
|
||||||
|
|
||||||
|
|
|
@ -33,6 +33,11 @@ is_object_valid 'user' 'USER' "$user" "$user"
|
||||||
#----------------------------------------------------------#
|
#----------------------------------------------------------#
|
||||||
|
|
||||||
for domain in $(search_objects 'web' 'SUSPENDED' "no" 'DOMAIN'); do
|
for domain in $(search_objects 'web' 'SUSPENDED' "no" 'DOMAIN'); do
|
||||||
|
# Reset BW counter on the start of the month
|
||||||
|
if [ "$(date +%d)" = '01' ]; then
|
||||||
|
update_object_value 'web' 'DOMAIN' "$domain" '$U_BANDWIDTH' '0'
|
||||||
|
fi
|
||||||
|
|
||||||
log_file="/var/log/httpd/domains/$domain.bytes"
|
log_file="/var/log/httpd/domains/$domain.bytes"
|
||||||
bytes=0
|
bytes=0
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue