Jelajahi Sumber

empty stats file (related to #59)

Serghey Rodin 13 tahun lalu
induk
melakukan
a63c3e2bb5
3 mengubah file dengan 7 tambahan dan 1 penghapusan
  1. 3 0
      bin/v-list-user-stats
  2. 3 0
      bin/v-list-users-stats
  3. 1 1
      install/vst-install.sh

+ 3 - 0
bin/v-list-user-stats

@@ -32,6 +32,9 @@ is_object_valid 'user' 'USER' "$user"
 
 # Defining config
 conf=$USER_DATA/stats.log
+if [ ! -e "$conf" ]; then
+    touch $conf
+fi
 
 # Defining fileds to select
 fields="\$DATE \$TIME \$PACKAGE \$IP_OWNED \$DISK_QUOTA \$U_DISK \$U_DISK_DIRS"

+ 3 - 0
bin/v-list-users-stats

@@ -29,6 +29,9 @@ check_args '0' "$#" '[FORMAT]'
 
 # Defining config
 conf=$VESTA/data/users/admin/overall_stats.log
+if [ ! -e "$conf" ]; then
+    touch $conf
+fi
 
 # Defining fileds to select
 fields="\$DATE \$TIME \$PACKAGE \$IP_OWNED \$DISK_QUOTA \$U_DISK \$U_DISK_DIRS"

+ 1 - 1
install/vst-install.sh

@@ -548,7 +548,7 @@ $VESTA/bin/v-add-cron-job 'admin' '*/30' '*' '*' '*' '*' "$command"
 command='sudo /usr/local/vesta/bin/v-backup-users'
 $VESTA/bin/v-add-cron-job 'admin' '10' '05' '*' '*' '*' "$command"
 command='sudo /usr/local/vesta/bin/v-update-user-stats'
-$VESTA/bin/v-add-cron-job 'admin' '20' '00' '01' '*' '*' "$command"
+$VESTA/bin/v-add-cron-job 'admin' '20' '00' '*' '*' '*' "$command"
 command='sudo /usr/local/vesta/bin/v-update-sys-rrd'
 $VESTA/bin/v-add-cron-job 'admin' '*/5' '*' '*' '*' '*' "$command"