cronjob没有在VM中运行

时间:2017-09-08 06:19:06

标签: linux unix cron

脚本文件:

<nav class="navbar navbar-toggleable-md navbar-light bg-faded">
  <div class="collapse navbar-collapse" id="navbarNavDropdown">
    <ul class="navbar-nav">
        <li class="nav-item dropdown">
            <a class="nav-link dropdown-toggle" id="users" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
              Usrs
            </a>
            <div class="dropdown-menu" aria-labelledby="users">
              <a class="dropdown-item" href="#">u1</a>
              <a class="dropdown-item" href="#">u2</a>
              <a class="dropdown-item" href="#">u3</a>
            </div>
          </li>
      <li class="nav-item dropdown">
        <a class="nav-link dropdown-toggle" id="tickets" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
          Tickets
        </a>
        <div class="dropdown-menu" aria-labelledby="tickets">
          <a class="dropdown-item" href="#">t1</a>
          <a class="dropdown-item" href="#">t2</a>
          <a class="dropdown-item" href="#">t3</a>
        </div>
      </li>
    </ul>
  </div>
</nav>

下一个crontab -e

#script.sh
#!/BIN/BASH
# To alert whenever lsof crosses 80%

maxlimit=32000
echo 'Max limit is ' $maxlimit
tlimit=$(bc <<< $maxlimit*0.8)
echo 'Treshold limit at 80% ' $tlimit
a=$(lsof | wc -l)
echo 'Current usage ' $a
if [ $(bc <<< "$a > $tlimit") -eq 1 ]
then
        echo 'lsof =' $a 'has exceeded 80% of maximum limit' | /usr/bin/Mail -s "ALERT!!!" "vsp@cisco.com"
fi

计划每分钟运行一次 但没有得到任何有关此

的细节
  • 我在VM的Linux终端中运行它
  • 当我手动运行时,我得到输出
  • 在crontab中加载时,会在日志中显示每分钟运行

0 个答案:

没有答案