Ver código fonte

Update netlog.sh

蘭雅sRGB 6 anos atrás
pai
commit
5f8fa09134
1 arquivos alterados com 12 adições e 4 exclusões
  1. 12 4
      netlog.sh

+ 12 - 4
netlog.sh

@@ -1,14 +1,22 @@
 #!/usr/bin/env bash
 
-echo '<pre>' > /var/www/log/index.html
+INDEX_HTML=/var/www/log/index.html
+
+echo '<pre>' > ${INDEX_HTML}
 
 vnstat -u
 
-vnstat -m >> /var/www/log/index.html
-vnstat -d >> /var/www/log/index.html
-vnstat -h >> /var/www/log/index.html
+vnstat -m >> ${INDEX_HTML}
+vnstat -d >> ${INDEX_HTML}
+vnstat -h >> ${INDEX_HTML}
 
+top | head -5 >> ${INDEX_HTML}
 
 ######################################
 
+# crontab -e   修改定时任务, 添加两行 
+
+#  # netlog.sh    https://github.com/hongwenjun/vps_setup/blob/master/netlog.sh
+#  8 *   *   *  *          wget -qO- git.io/fxxlb | bash
+
 ######################################