在运行脚本时,我收到了以下错误:
第6行:[::预期整数表达式
我可以想象括号内的代码是一个整数,但是,我看不出它在哪里出错。能告诉我怎么解决这个问题吗?
if [ "$( df -h | grep hda1 | cut -c40-42)" -ge "80" ]; then
echo Subject: Production Server : Low Disk Space : Daily reporting for Server
fi
几个小时前,我的根分区被填充,我将文件从其中移开,df报告:
# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/hda1 183G 174G 0 100% /
因此,应该有9GB的免费,但效用报告0和使用仍然是100%。
我测试为根,例如。
# echo test >a ; cat a
test
它按预期工作;但是,作为一个普通用户,我仍然会得到错误:
$ echo test >a ; cat a
bash: echo: write error: No space
我刚升级到14.04,当我尝试升级时,我得到:
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
linux-generic : Depends: linux-image-generic (= 3.13.0.55.62)