Category - Linux

2019-01-11 16:22:44    748    0    0

在系统日志设置中打开定时任务的日志

vi /etc/rsyslog.d/50-default.conf

#cron.*

去掉 #

重启系统日志

sudo service rsyslog restart

查看crontab 日志

在/var/log/ 下 tail -f cron.log

? linux ?    2019-01-11 16:22:44    468    0    0

虚拟机安装时的报错:

1. Cannot set up guest memory 'pc.ram'

Starting install...
Allocating 'vm-build.img' | 50 GB 00:00
ERROR internal error: process exited while connecting to monitor: Cannot set up guest memory 'pc.ram': Cannot allocate memory

Domain installation does not appear to have been successful.

 

2019-01-11 16:22:44    382    0    0

在 A-PC 免密码登录到 B-PC ,C-PC 

A-PC :

1. 生成当前用户的公钥

ssh-keygen -t rsa -P '' 

cd ~/.ssh

-rw------- 1 jenkins jenkins 1679 Nov 30 11:16 id_rsa
-rw-r--r-- 1 jenkins jenkins 399 Nov 30 11:16 id_rsa.pub

2. 发布公钥到需要免密码登录的各个设备

....... 

2019-01-11 16:22:44    735    0    0

 1. 前提: 

运行脚本的机器上,ssh免密登录需要编译的server,被统计的server 使用同一帐号。

2. 登录并执行:

使用ssh 登录并执行 who , uptime 等实时信息,并赋值给变量,在运行脚本的机器上打印出来。

脚本示例

7/7