I have this simple (looks simple to me!) procedure file (~/get_smart_daily)
But when I try running it by hand (
...and I've no idea what it thinks it's complaining about. The only file mentioned, apart from ~/smart_data which hasn't been created yet, is smartctl and it's obviously finding that.
Code:
#!/bin/sh
rm ~/smart_data
/usr/local/sbin/smartctl -t short -d ata /dev/ada0
/usr/local/sbin/smartctl -t short -d ata /dev/ada1
/usr/local/sbin/smartctl -t short -d ata /dev/ada2
/usr/local/sbin/smartctl -t short -d ata /dev/ada3
sleep 1800
/usr/local/sbin/smartctl -HAl selftest -d ata /dev/ada0 > ~/smart_data
/usr/local/sbin/smartctl -HAl selftest -d ata /dev/ada1 >> ~/smart_data
/usr/local/sbin/smartctl -HAl selftest -d ata /dev/ada2 >> ~/smart_data
/usr/local/sbin/smartctl -HAl selftest -d ata /dev/ada3 >> ~/smart_data
mail -s "daily smart status" root < ~/smart_data
But when I try running it by hand (
sh -x ~/get_smart_daily
) for debugging, it complains
Code:
sh -x ~/get_smart_daily
+ rm /root/smart_data
: No such file or directory
+ /usr/local/sbin/smartctl -t short -d ata /dev/ada0
smartctl 6.4 2015-06-04 r4109 [FreeBSD 10.2-RELEASE amd64] (local build)
Copyright (C) 2002-15, Bruce Allen, Christian Franke, www.smartmontools.org
failed: No such file or directory
+ /usr/local/sbin/smartctl -t short -d ata /dev/ada1
smartctl 6.4 2015-06-04 r4109 [FreeBSD 10.2-RELEASE amd64] (local build)
Copyright (C) 2002-15, Bruce Allen, Christian Franke, www.smartmontools.org
failed: No such file or directory
+ /usr/local/sbin/smartctl -t short -d ata /dev/ada2
smartctl 6.4 2015-06-04 r4109 [FreeBSD 10.2-RELEASE amd64] (local build)
Copyright (C) 2002-15, Bruce Allen, Christian Franke, www.smartmontools.org
failed: No such file or directory
+ /usr/local/sbin/smartctl -t short -d ata /dev/ada3
smartctl 6.4 2015-06-04 r4109 [FreeBSD 10.2-RELEASE amd64] (local build)
Copyright (C) 2002-15, Bruce Allen, Christian Franke, www.smartmontools.org
failed: No such file or directory
+ sleep 1800
...and I've no idea what it thinks it's complaining about. The only file mentioned, apart from ~/smart_data which hasn't been created yet, is smartctl and it's obviously finding that.