↑ ↓ select, Enter open, Esc close

Find out which cron job runs a command

Adjust the values, the command updates live
root@server
grep -rn "wp-cron.php" /etc/crontab /etc/cron.d /etc/cron.hourly /etc/cron.daily /etc/cron.weekly /etc/cron.monthly /var/spool/cron/crontabs 2>/dev/null

Searches recursively in all places where cron jobs can live on Debian and prints file name, line number and match. In /var/spool/cron/crontabs/, the file name is the user. Useful when an unknown process keeps showing up regularly and you are looking for its trigger.

Note: systemd timers are not covered here. Their units can be found with grep -rl in the /etc/systemd/system directory.

Also searched as

  • which cron job starts this script
  • what is calling wp-cron.php
  • find cron job behind a process
  • search cron jobs for a string

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.