# 开启定时任务服务
service crond start
开启croud的时候如果出现Redirecting to /bin/systemctl start crond.service,
即service crond start 需要替换为systemctl方式
# 查看定时任务服务状态
service crond status
# 打开定时任务编辑窗口
crontab -e
# 添加两条定时任务,即每天0点0分和12点20分各执行一次,并写入日志
0 0 * * * /usr/bin/python /home/longrise/psrd/collect.py > /home/longrise/psrd/collect.log 2>&1 &
20 12 * * * /usr/bin/python /home/longrise/psrd/collect.py > /home/longrise/psrd/collect.log 2>&1 &