The start of a script for doing one long-test every. Will work fine if you have fewer drives than days in month.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
DRIVES=`/sbin/sysctl -n kern.disks` | |
DAY=`/bin/date +"%Oe"` | |
# yes, I could jump to the DAY-th element of the list | |
# Do you know how to do that? | |
TESTED='' | |
i=0; | |
for drive in ${DRIVES} | |
do | |
i=`expr ${i} + 1`; | |
if [ ${i} == ${DAY} ] | |
then | |
echo today I run a test on ${drive} | |
TESTED=${drive} | |
break; | |
fi | |
done | |
if [ "${TESTED}XX" == "XX" ] | |
then | |
echo nothing to test today | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment