Linux程式设计-11.ShellScript(bash)--(4)档案系..
时间:2008-05-10 来源:sdccf
iTbulo.COM |
-------------------------------------------------------------------------------- #!/bin/sh #Filename:whatever_you_name_it DIRS="/etc/home/bin/sbin/usr/bin/usr/sbin/usr/local/var/your_directory" ADMIN="[email protected]" FROM="[email protected]" #写入Sendmail的标头 echo"Subject:$HOSTNAMEfilesystemcheck">/tmp/today.mail echo"From:$FROM">>/tmp/today.mail echo"To:$ADMIN">>/tmp/today.mail echo"Thisisfilesystemreportcomesfrom$HOSTNAME">>/tmp/today.mail #报告目前正在执行的程式 psaxf>>/tmp/today.mail #档案系统检查 echo"FileSystemCheck">>/tmp/today.mail ls-alR$DIRS|gzip-9>/tmp/today.gz zdiff/tmp/today.gz/tmp/yesterday.gz>>/tmp/today.mail mv-f/tmp/today.gz/tmp/yesterday.gz #寄出信件 sendmail-t |
相关阅读 更多 +