Quote:
Originally Posted by QuestionMqrk
Here's the end result of the shebang;
Code:
>0 11 * * * /usr/sbin/smartctl -aixcA -d sat /dev/sda > /home/michaelzheludev/CRON/smartctl-output-$(/bin/date +\%d\%m\%y)
in case someone needs to do something similar in the future.
|
Glad you got sorted.
You'll find that many admins (myself included) would have used a script rather than modify the cron job, so you'd end up with:
/root/getsmart.sh
Code:
#!/bin/bash
# Author : TenTenths
# Purpose: Dump drive smartctl data to log file
# Version: 1.0
# Date : 5th Oct 2016
# Version History
# 1.0 Initial version
# Set your options and log file as appropriate
LOGFILE="/home/michaelzheludev/CRON/smartctl-output-$(/bin/date +%d%m%y)"
OPTIONS="-aixcA -d sat /dev/sda"
# Script logic starts here
/usr/sbin/smartctl ${OPTIONS} >> ${LOGFILE}
# Elvis Has Left The Server
Then your cron can just be:
Code:
00 11 * * * /root/getsmart.sh