ubuntu下crond常用命令

## ubuntu 下crond命令

“`

    service cron start    //启动服务

    service cron stop     //关闭服务

    service cron restart  //重启服务

    service cron reload   //重新载入配置

    service cron status   //查看服务状态

    tail /var/log/syslog  //使用crontab进行设置定时任务,任务没有执行,查看系统日志排查

    ps -ef | grep cron  //查看cron 进程是否存在

“`

配置用户

crontab [ -u user ] [ -i ] { -e | -l | -r } //省略用户表示操作当前用户的crontab

安装

sudo apt-get install cron

laravel 配置

    > * * * * * php /项目目录/artisan schedule:run >> /dev/null 2>&1