I have a bash script that runs a lot of commands/tools like convert or pdftk via CRON.
It happens quite often that e.g. pdftk becomes "stale" or "hangs" and the calling script stops proceeding.
Is there a simple way from within the bash script (via trap?) to set a time limit for execution or detect inactivity (by whatever definition) for a specific call?