File tree Expand file tree Collapse file tree 3 files changed +11
-1
lines changed
Expand file tree Collapse file tree 3 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ TOTAL_U_CRON_JOBS=0
6565TOTAL_U_BACKUPS=0
6666
6767# Updating user stats
68- for user in $user_list ; do
68+ for user in $user_list ; do
6969 USER_DATA=$VESTA /data/users/$user
7070 source $USER_DATA /user.conf
7171 next_month=$( date +' %m/01/%y' -d ' + 1 month' )
Original file line number Diff line number Diff line change @@ -61,6 +61,11 @@ echo > $log_file
6161# Vesta #
6262# ----------------------------------------------------------#
6363
64+ # Reset counter on the start of the month
65+ if [ " $( date +%d) " = ' 01' ]; then
66+ update_object_value ' web' ' DOMAIN' " $domain " ' $U_BANDWIDTH' ' 0'
67+ fi
68+
6469# Parsing old value
6570get_domain_values ' web'
6671
Original file line number Diff line number Diff line change @@ -33,6 +33,11 @@ is_object_valid 'user' 'USER' "$user" "$user"
3333# ----------------------------------------------------------#
3434
3535for domain in $( search_objects ' web' ' SUSPENDED' " no" ' DOMAIN' ) ; do
36+ # Reset BW counter on the start of the month
37+ if [ " $( date +%d) " = ' 01' ]; then
38+ update_object_value ' web' ' DOMAIN' " $domain " ' $U_BANDWIDTH' ' 0'
39+ fi
40+
3641 log_file=" /var/log/httpd/domains/$domain .bytes"
3742 bytes=0
3843
You can’t perform that action at this time.
0 commit comments