0

In /var/log/cron.log I noticed that CRON runs "@reboot jobs" right after I start my computer.

Is there a way for me to see the list of the jobs CRON triggers then?

2 Answers 2

1

I don't think there's an easy way to see all configured cron jobs.

First, check the global crontab file under /etc/crontab for anything containing @reboot.

grep '^\s*@reboot' /etc/crontab

As root, you can check the crontab of your users like this:

crontab -u $user -l | grep '^\s*@reboot'
4
  • 1
    grep '^\s*@reboot' for both should be precise. Commented Oct 1, 2020 at 11:02
  • @rexkogitans thanks for the headsup! Edited the answer.
    – Panki
    Commented Oct 1, 2020 at 11:39
  • For the first command I get no output, and for the second command I get "sudo: unknown user -l; sudo: unable to initialize policy plugin" I don't know the meaning about the policy plugin. Going back to the first command, would this mean that although @reboot runs, there are no jobs to trigger?
    – u20200411
    Commented Oct 2, 2020 at 5:05
  • You need to replace $user with the name of a user on your system.
    – Panki
    Commented Oct 2, 2020 at 7:50
1

You can run

sudo sh -c 'cat /etc/crontab \
  /etc/cron.d/* \
  /var/spool/cron/crontabs/*'

to see all cron jobs.

Filter it with

sudo sh -c 'cat /etc/crontab \
  /etc/cron.d/* \
  /var/spool/cron/crontabs/*' | grep '^\s*@reboot'

(as noted by @rexkogitans)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .