Skip to main content
added 942 characters in body; edited tags
Source Link
dot
  • 755
  • 5
  • 12
  • 24

I'd like to know if there's a way to find out when the next time a cron job will run - via a bash job. Has anyone tried something like this?

I've been googling but I haven't found anything yet.

Thanks.

EDIT 1

Just some more details of what I'm after. When I check crontab -l, see the following output:

lab-1:/etc/crontabs# crontab -l # do daily/weekly/monthly maintenance # min hour day month weekday command */15 * * * * run-parts /etc/periodic/15min 0 * * * * run-parts /etc/periodic/hourly 0 2 * * * run-parts /etc/periodic/daily 0 3 * * 6 run-parts /etc/periodic/weekly 0 5 1 * * run-parts /etc/periodic/monthly #Ansible: Run every minute * * * * * run-parts /etc/periodic/1min 

What I need to know is not just that the 15 minute folder is "enabled" but if there's a way, I'd like to know that for example, 3 minutes from now, the job in the 15 minute folder will be triggered.

Is there any way to do this?

I'd like to know if there's a way to find out when the next time a cron job will run - via a bash job. Has anyone tried something like this?

I've been googling but I haven't found anything yet.

Thanks.

I'd like to know if there's a way to find out when the next time a cron job will run - via a bash job. Has anyone tried something like this?

I've been googling but I haven't found anything yet.

Thanks.

EDIT 1

Just some more details of what I'm after. When I check crontab -l, see the following output:

lab-1:/etc/crontabs# crontab -l # do daily/weekly/monthly maintenance # min hour day month weekday command */15 * * * * run-parts /etc/periodic/15min 0 * * * * run-parts /etc/periodic/hourly 0 2 * * * run-parts /etc/periodic/daily 0 3 * * 6 run-parts /etc/periodic/weekly 0 5 1 * * run-parts /etc/periodic/monthly #Ansible: Run every minute * * * * * run-parts /etc/periodic/1min 

What I need to know is not just that the 15 minute folder is "enabled" but if there's a way, I'd like to know that for example, 3 minutes from now, the job in the 15 minute folder will be triggered.

Is there any way to do this?

Source Link
dot
  • 755
  • 5
  • 12
  • 24

cron jobs - can you query the environment to find out when a job is about to run next?

I'd like to know if there's a way to find out when the next time a cron job will run - via a bash job. Has anyone tried something like this?

I've been googling but I haven't found anything yet.

Thanks.