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
1. Development environment vue 2. Computer system...
1 MySQL autocommit settings MySQL automatically c...
This article shares the specific code of Vue to a...
Documentation: https://github.com/hilongjw/vue-la...
Docker installation 1. Requirements: Linux kernel...
This article describes the Linux file management ...
Table of contents 1. Sample code 2. See the essen...
Overview I have been using Docker for more than a...
This article shares with you two methods of setti...
Arial Arial is a sans-serif TrueType font distribu...
byzhangxinxu from https://www.zhangxinxu.com/word...
Preface Swap is a special file (or partition) loc...
When the database concurrently adds, deletes, and...
Table of contents 1. Cause 2. Equipment Informati...
When the table header is fixed, it needs to be di...