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
When you need to create an email in a shell scrip...
This article shares 3 methods to achieve the spec...
When using MySQL, dates are generally stored in f...
Install Nginx on Docker Nginx is a high-performan...
Now 2016 server supports multi-site https service...
MySQL multi-condition query with AND keyword. In ...
1|0 Compile the kernel (1) Run the uname -r comma...
question: When developing the Alice management sy...
Table of contents Zabbix custom monitoring nginx ...
This article shares the specific code of the WeCh...
The methods of installing nginx and multiple tomc...
Table of contents cause: go through: 1. Construct...
<br />Related articles: How to prompt and op...
1. Docker network management 1. Docker container ...
SQL Left Join, Right Join, Inner Join, and Natura...