# Edit this file to introduce tasks to be run by cron. # # Each task to run has to be defined through a single line # indicating with different fields when the task will be run # and what command to run for the task # # To define the time you can provide concrete values for # minute (m), hour (h), day of month (dom), month (mon), # and day of week (dow) or use '*' in these fields (for 'any').# # Notice that tasks will be started based on the cron's system # daemon's notion of time and timezones. # # Output of the crontab jobs (including errors) is sent through # email to the user the crontab file belongs to (unless redirected). # # For example, you can run a backup of all your user accounts # at 5 a.m every week with: # 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/ # # For more information see the manual pages of crontab(5) and cron(8) # # m h dom mon dow command ^G Get Help ^O Write Out ^W Where Is ^K Cut Text ^J Justify ^C Cur Pos M-U Undo M-A Mark Text ^X Exit ^R Read File ^\ Replace ^U Uncut Text ^T To Spell ^_ Go To Line M-E Redo M-6 Copy Text这样的界面我要怎么输出啊
时间: 2024-02-10 17:09:15 浏览: 23
这是一个 crontab 文件的示例,它包含了一些注释和示例命令,用于说明如何定义 cron 任务。如果你想编辑该文件,可以使用以下命令:
```
crontab -e
```
该命令会打开一个文本编辑器,让你编辑当前用户的 crontab 文件。在编辑器中,你可以添加、修改或删除 cron 任务,然后保存文件并退出编辑器。
如果你只是想查看当前用户的 crontab 文件,可以使用以下命令:
```
crontab -l
```
该命令会将当前用户的 crontab 文件输出到终端。
相关问题
GNU nano 2.9.3 /tmp/crontab.afdNF3/crontab # Edit this file to introduce tasks to be run by cron. # # Each task to run has to be defined through a single line # indicating with different fields when the task will be run # and what command to run for the task # # To define the time you can provide concrete values for # minute (m), hour (h), day of month (dom), month (mon), # and day of week (dow) or use '*' in these fields (for 'any').# # Notice that tasks will be started based on the cron's system # daemon's notion of time and timezones. # # Output of the crontab jobs (including errors) is sent through # email to the user the crontab file belongs to (unless redirected). # # For example, you can run a backup of all your user accounts # at 5 a.m every week with: # 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/ # # For more information see the manual pages of crontab(5) and cron(8) # # m h dom mon dow command 0 12 * * * /home/sjt/work/date/0605/log.sh为哈就是一直卡在这里
看起来你正在编辑一个 crontab 文件,这个文件中包含了定时任务的配置信息。你想要添加一个定时任务,让 `/home/sjt/work/date/0605/log.sh` 脚本每天中午 12 点执行一次。
根据 crontab 文件的格式,你可以在文件中添加以下一行来实现:
```
0 12 * * * /home/sjt/work/date/0605/log.sh
```
这行中的五个时间字段 `0 12 * * *` 分别表示分钟、小时、月中的天、月份、周中的天。`*` 表示任意值,因此这行的含义就是每天中午 12 点执行一次 `/home/sjt/work/date/0605/log.sh` 脚本。
完成修改后,保存并退出 crontab 文件即可。
crontab -l
`crontab -l`命令用于列出当前用户的cron作业列表。它将显示当前用户的所有cron作业,如果没有作业,则不会显示任何内容。以下是一个示例输出:
```shell
$ crontab -l
# Edit this file to introduce tasks to be run by cron.
#
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
#
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use '*' in these fields (for 'any').
#
# Notice that tasks will be started based on the cron's system
# daemon's notion of time and timezones.
#
# Output of the crontab jobs (including errors) is sent through
# email to the user the crontab file belongs to (unless redirected).
#
# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
#
# For more information see the manual pages of crontab(5) and cron(8)
#
# m h dom mon dow command
*/5 * * * * /usr/bin/python3 /home/user/myscript.py
```