Originally posted by: SystemAdmin
Here is a very basic script. Test, modify, and run from crontabs.
#!/usr/bin/ksh
days_to_email=90
uptime | uptimeLine=$(line)
set $uptimeLine
days=$3
email_list="user@domain"
if [
$days -gt $days_to_email ]; then
cat <<- EOF | mailx -s "Overdue reboot on $(hostname)" $email_list
Hi from root on $(hostname),
The uptime command shows: $uptimeLine
It may be time for a reboot?
EOF
fi
#AIX-Forum