相关代码 |
|
#!/bin/bash LOGDIR=/var/log/netlog While : Do DATE = 'date –d today + %y%m%d ' TIME = 'date -d today +%T ' Echo "$TIME || 'ping $1 -c 1 -w 1 | sed -n '2p' | awk '{if($6 == "") ($6="request timeout "): print $6,$7}' '" >>${LOGDIR}/${1}_$DATE.log Sleep 1 Done
相关资源 |
|