output.txt # this would save the output from the status unix command in output.txt status unix > ~/tmp/output.txt rm -f output.txt # puts the file in a tmp folder and then delets when done stat ouput.txt | grep Modify | sed 's/^Modify: //g' date -d "$(stat output.txt | grep Modify | sed 's/^Modify: //g')" +%s # how old the file is in sec from the start of time ftime=`date -d "$(stat output.txt | grep Modify | sed 's/^Modify: //g')" +%s` # saves the time in a file called ftime ctime=`date +%s` let dtime=$ctime-$ftime echo $dtime time command # shows the amount of time to run the command at 531pm # runs the command at 531pm cron/crontab