Try using date passed to a variable
$ xx=`date '+%T'`
$ echo $xx
11:59:38
You'll have to cater for when the minute is geater than 55
look at the date man page
Try do a Script something like this
my_cron.sh
crontab -l > /tmp/new_cron.out
if [ $COND = "VARIABLE" ]
then
echo "00 23 * * * command" >> /tmp/new_cron.out
crontab /tmp/new_cron.sh
else
echo "Cron will not be changed this time - condition not meet" | mailx -s...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.