Linux9.26

Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
This link: https://blog.csdn.net/weixin_45213666/article/details/101471864

demo loop for
Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description
a while loop
Here Insert Picture Description
small game viewing, while loops, if statements

Here Insert Picture Description
csec statement
Here Insert Picture Description
Here Insert Picture Description

Here Insert Picture Description
猜数字小游戏
while循环 if语句
Here Insert Picture Description
计划任务服务程序
设置服务器的计划任务服务,把周期性、规律性的工作交给系统自动完成。
计划任务分为一次性计划任务与长期性计划任务
一次性计划任务:只执行一次,一般用于临时的工作需求。
长期性计划任务:按照设定的时间周期,重复执行用户指定的命令操作。
1.at命令:
用于设置一次性计划任务。格式:at [时间]/[参数]。
at 时间 开始编写任务
Ctrl+D 退出编写
at -l 显示编写的任务
atrm 任务 删除任务
Here Insert Picture Description
2.crontab命令
1).Linux中默认启用的crond服务是用来周期性的执行某种任务或等待处理某些事件的一个守护进程。crond服务通过crontab命令来实现
crontab命令:用于配置周期性计划任务。格式:crontab [选项]。
2).常用参数:
e:创建、编辑计划任务;
-l:查看当前计划任务;
-r:删除某条计划任务;
-u:编辑对应用户的计划任务(管理员身份才能用);
3).使用crond设置任务的参数格式:分 时 日 月 星期 命令,如果有些字段没有设置,则使用星号(*)占位。
使用crond设置任务的参数字段说明
字段 说明
分钟 取值为0 ~ 59的整数
Hour arbitrary integer ranging from 0 to 23
dates: any integer value of 1 to 31
month value is any integer from 1 to 12
weeks is any integer value from 0 to 7, where 0 and 7 are Sunday
command the command to execute a program or script

Guess you like

Origin blog.csdn.net/weixin_45213666/article/details/101471864