いいかげん自動作成するようにした。
#!/usr/bin/perl @montable = ("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"); $time=time()-86400; ($year, $mon, $day) = (localtime($time))[5,4,3]; $cmd=sprintf('sudo grep "%s %2d" /var/log/kern.log|grep kernel:', $montable[$mon], $day); $file=sprintf('/home/tnh/diary/%04d/d%04d%02d%02d.hnf', $year+1900, $year+1900, $mon+1, $day); $data=`$cmd`; unless(-e $file){ open(FL,">$file"); print FL "OK\n"; close(FL); } open(FL,">>$file"); print FL "\n"; print FL "CAT Linux\n"; print FL "NEW 今日のパケット\n"; print FL "\n"; if($data){ print FL "PRE\n"; print FL $data; print FL "/PRE\n"; }else{ print FL "P\n"; print FL "平和\n"; print FL "/P\n"; } close(FL);