全部博文(339)
发布时间:2020-11-04 23:08:47
cat /dev/null > log.txt2. 脚本注释、占位符#!/bin/sh : this is single line comment : 'this is a multiline comment, second li.........【阅读全文】
发布时间:2020-11-03 23:22:32
1. 监控服务器的活动状态#!/bin/bash ip=127.0.0.1while true do ping -c1 $ip>/dev/null 2>/dev/null if [ $? == "0" ];then echo "`date "+%Y-%m-%d %H:%M:%S "`$ip is up">>a.log fi sleep 1done写一个工具,对 127.0.0.1 持续监控,当网络断开时,记录时.........【阅读全文】