Original link: https://vien.tech/article/157 Preface This article will introduce how to schedule the execution of shell scripts and python scripts under Ubuntu system. Ubuntu system has a scheduled task manager crontab. We only need to edit the scheduled task and then restart the scheduled task service. crontab Editing scheduled tasks crontab -e Parameter definition:
English introduction:
Chinese explanation: Format
The above are abbreviations, here is the full spelling comparison:
The meaning is as follows:
other:
Restart the service service cron restart Precautions Note that you must use an absolute path. Otherwise the execution may fail. For example, we want to execute python bwh.py So the first thing you need to do is which python This is to view the real path of the python command root@ubuntu:~# which python /root/.pyenv/shims/python Then, check the full path of bwh.py in the folder where bwh.py is located. pwd /app/python/blog Then the path is /app/python/blog/bwh.py So the whole record should be edited like this 0 9 * * * /root/.pyenv/shims/python /app/python/blog/bwh.py > /tmp/new_blog_bwh.log The above record means that Summarize The above is the full content of this article. I hope that the content of this article will have certain reference learning value for your study or work. Thank you for your support of 123WORDPRESS.COM. You may also be interested in:
|
<<: How to make JavaScript sleep or wait
>>: MySQL slow log online problems and optimization solutions
IIS7 needs to confirm whether the "URL REWRI...
Detailed explanation of mysql count The count fun...
This article shares the specific code of Vue usin...
The main contents of this article are as follows:...
We often see a cool effect where the mouse hovers...
need: Use vue to realize QR code scanning; Plugin...
1. Division of labor and process <br />At T...
Introduction to Docker Docker is an open source a...
Table of contents 1 View the current database con...
1. this.$router.push() 1. Vue <template> &l...
In HTML, you need to specify the encoding used by...
This article shares the specific code of JavaScri...
1. Varnish Overview 1. Introduction to Varnish Va...
1. Preparation 1.1 harbor download harbor downloa...
Object.defineProperty Understanding grammar: Obje...