Linux at命令与crond命令,Linux主机之间ssh免密登录
一.atd和crond两个任务管理程序的区别
atd是单一执行的任务管理程序,一个任务管理程序只会执行一次任务
crond是循环性执行好的任务管理程序,例如可以在每年,每月,每天,某个时间段进行执行任务。
二.指定在2023/08/26 09:00将时间写入testmail.txt文件中
[root@localhost ~]# touch testmail.txt
[root@localhost ~]# at 09:00 2023-08-26
warning: commands will be executed using /bin/sh
at> date >> ./testmail.txt
at> <EOT>
job 1 at Sat Aug 26 09:00:00 2023
三.指定在每天凌晨4:00将该时间点之前的系统日志信息备份到个目录下(/var/log/messages ),备份后日志文件名显示格式logfileYY-MM-DD HH-MM
[root@localhost ~]# crontab -e
no crontab for root - using an empty one
crontab: installing new crontab
[root@localhost ~]# crontab -l
00 4 * * * cp /var/log/messages /logfile`date %F%T`
四.写出linux主机之间ssh免密登陆的过程
前置步骤
systemctl stop firewalld
setenforce 0
1.client创建密钥
ssh-keygen -t RSA
2.查看文件
ll ~/.ssh
3.发送密钥
ssh-copy-id 192.168.43.139
4.验证
ssh 192.168.43.139

浙公网安备 33010602011771号