↑ ↓ select, Enter open, Esc close

Show currently running cron jobs

user@server
ps -eo pid,user,etime,cmd --forest | grep -A3 '[C]RON'

For each job it starts, the cron service forks a child process named CRON, with the shell and the actual command below it. The tree view shows this chain with user and elapsed time (ELAPSED). A job running for several hours that should take minutes is probably hanging.

Note: The square brackets in the pattern prevent grep from matching itself. The main daemon appears as /usr/sbin/cron -f in lowercase and is therefore not matched.

Open question before approval: Prüfen, ob die von cron geforkten Kindprozesse auf Debian 12 in ps tatsächlich als /usr/sbin/CRON -f erscheinen und -A3 bei verschachtelten Jobs genug Zeilen zeigt.

Also searched as

  • is the cron job still running
  • hanging cron job
  • which cron jobs are running now
  • cron job running for hours

Related one-liners

All in Cron

Read first, then run.

The commands on myline.de act directly on servers, files and databases. A wrong path or placeholder can delete data irreversibly or make a server unreachable.

  • All commands are provided without warranty and are not tested on every system.
  • Understand what a command does before running it, and check every placeholder.
  • Make a backup first and, if possible, try it on a test system.
  • You run commands at your own risk. Liability for damages is excluded to the extent permitted by law.