I'm using CentOS6.4 and updatedb is running as a daily job. What should I do if I want to know how long it takes for updatedb to run?


You can use the time bash builtin. Consider this example and modify the cron job accordingly:

$ time ( ls -lrt &>/dev/null )

real    0m0.002s
user    0m0.000s
sys     0m0.001s

You can also redirect the output somewhere else:

time ( $CRON_JOB_CODE ) &> /var/log/updatedb.time.log

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.