Tags
Asked 4 years ago
13 Dec 2019
Views 702
steave ray

steave ray posted

how to set cron with python file ?

i have no server so i cant use wget to run server . i have single file livefetch.py
so i want to setup cron for the single file of python

how to set cron with python file ?
Nilesh

Nilesh
answered Nov 30 '-1 00:00


You can use nohup


nohup python3 runsinglefile.py


nohup stand for "no hungup"
at command shell , nohup will help to continue to run given command if one logout or exit from shell

but it wont help you to long run or periodic cron run
python

python
answered Nov 30 '-1 00:00

you can set cron by crontab to set cron for python file

following command to edit /add the cron at crontab

crontab -e


below code run cron every 5 minute

*/5* * * * /pathtofile/first.py


Post Answer