-1

I have a crontab file located at /usr/bin/crontab.

It's supposed to run every day at 7:30a est. I don't want to have to wait hours to see if it runs. Aside from changing the time it runs, are there other places I can look to ensure that the script will run at the desired time? I basically want to ensure the crontab file has been loaded in

Thanks!

Edit: When I vi /etc/spool/cron/crontabs, I see

   CGroup: /system.slice/cron.service
" ============================================================================
" Netrw Directory Listing                                        (netrw v156)
"   crontabs
"   Sorted by      name
"   Sort sequence: [\/]$,\<core\%(\.\d\+\)\=\>,\.h$,\.c$,\.cpp$,\~\=\*$,*,\.o$,\.obj$,\.info$,\.swp$,\.bak$,\~$
"   Quick Help: <F1>:help  -:go up dir  D:delete  R:rename  s:sort-by  x:special
" ==============================================================================
../
~
~
jww
  • 97,681
  • 90
  • 411
  • 885
Zack Shapiro
  • 6,648
  • 17
  • 83
  • 151
  • Don't edit the master crontab. Instead, use `crontab -e` to edit your *personal* crontab. – wildplasser Dec 25 '19 at 18:37
  • @wildplasser, what OP try to edit is directory where cron records are stored – Romeo Ninov Dec 25 '19 at 18:38
  • 1
    Yes, but that is not what he *should* be doing. – wildplasser Dec 25 '19 at 18:43
  • 1
    Possible duplicate of [How to test a cron job?](https://stackoverflow.com/q/5837615/608639), [How to test a weekly cron job?](https://stackoverflow.com/q/4984725/608639), [Verify if crontab works](https://askubuntu.com/q/85558), [Running a cron job manually and immediately](https://serverfault.com/q/85893), [Manually run a cron job / simulate running cron job?](https://unix.stackexchange.com/q/49419), [How can I make cron run a job right now, for testing/debugging? without changing the schedule!](https://unix.stackexchange.com/q/42715), etc. – jww Dec 25 '19 at 19:28

2 Answers2

0

You can check the spool directory for awaiting cron jobs.

The location of cron files for individual users is /var/spool/cron/crontabs/

From man crontab:

Each user can have their own crontab, and though these are files in /var/spool/cron/crontabs, they are not intended to be edited directly.

If it's there it will run.

Paul Dawson
  • 1,332
  • 14
  • 27
0

You can execute command

crontab -l

This will list all cron records for your user Also you can check if cron daemon is run

ps -efl|grep cron

With this command you can check (postfactum) what is the result of cron execution

sudo grep CRON /var/log/syslog

You can't easy speedup the things, just wait till desired time. Or schedule the same job to be executed 10-15 minutes after your current time.

P.S. And /etc/spool/cron/crontabs is directory. See the top of this answer

Romeo Ninov
  • 6,538
  • 1
  • 22
  • 31