linux系统下crontab 配置启动定时任务

时间:2022-10-12 08:04:36

1 crontab -e 配置启动定时任务

    */1 * * * * sh /home/admin/application/wd/core-python/getMemPositionFromAnaualOrChangeInfo/start.sh

#start.sh 为启动文件
start.sh文件里面的内容:
#! /bin/bash
#~ /home/admin/.bashrc
cd /home/admin/application/wd/core-python/getMemPositionFromAnaualOrChangeInfo/
nohup /home/admin/anaconda3/bin/python -u /home/admin/application/wd/core- python/getMemPositionFromAnaualOrChangeInfo/main2.py >> /home/admin/application/wd/core-python/getMemPositionFromAnaualOrChangeInfo/test.log &~