shell 脚本

#!/bin/bash

a=`netstat -unltp|grep fdfs|wc -l`

echo "$a"
if [ "$a" -ne "1" ];then
    `fdfs_storaged /etc/fdfs/storage.conf start`
fi

 用 crontab 设定定时任务

crontab -e,一分钟执行一次脚本
* * * * * sh /home/fr/test.sh

 查看 crontab 日志

 tailf var/log/cron

  

相关文章:

  • 2022-01-19
  • 2022-12-23
  • 2022-02-12
  • 2021-12-14
  • 2021-11-01
  • 2021-07-30
  • 2021-06-13
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-07-13
  • 2021-11-15
  • 2022-12-23
  • 2021-12-20
  • 2021-08-12
  • 2021-11-01
相关资源
相似解决方案