0

I've always used cpanel to set up con jobs but I don't have cpanel now. So I added a PHP file in the cron.hourly but I want to be sure it will run. There must be some way to do this. Like a command that lists all the cron jobs that exist? I am on Debian 7 64 bit.

user3349060
  • 5
  • 2
  • 5
  • See http://unix.stackexchange.com/questions/7053/how-can-get-a-list-of-all-scheduled-cron-jobs-on-my-machine – NoChance Jan 10 '15 at 04:58
  • So as long as they are in that dir they will for sure run. Correct? – user3349060 Jan 10 '15 at 04:59
  • I think may help. Try to get all the cronjobs, if yours there it will run for sure. Check it out http://stackoverflow.com/questions/134906/how-do-i-list-all-cron-jobs-for-all-users – Suneel Kumar Jan 10 '15 at 05:01
  • possible duplicate of [Validating Crontab Entries w/ PHP](http://stackoverflow.com/questions/235504/validating-crontab-entries-w-php) – Jasen Jan 10 '15 at 05:02
  • How would I see all cron jobs curently running? Jason: This isn't about PHP. Yes the script being ran will be PHP but i'm asking for a command to run. – user3349060 Jan 10 '15 at 05:05
  • Stack Overflow is a site for programming and development questions. This question appears to be off-topic because it is not about programming or development. See [What topics can I ask about here](http://stackoverflow.com/help/on-topic) in the Help Center. Perhaps [Super User](http://superuser.com/) or [Unix & Linux Stack Exchange](http://unix.stackexchange.com/) would be a better place to ask. Also see [Where do I post questions about Dev Ops?](http://meta.stackexchange.com/q/134306). – jww Aug 15 '16 at 22:58

2 Answers2

0

If you use crontab -e the crontab job will be syntax-checked

If you are just editing /etc/crontab or /etc/cron.*/* there is no automatic checking

nothing will check the code of your job will actually run successfully.

Jasen
  • 11,837
  • 2
  • 30
  • 48
  • The code should run. As long as it is executed in the same dir. (I'm pretty sure crons do this?) Iv'e tested them. I'm just hesitant I didn't do the crons right – user3349060 Jan 10 '15 at 05:04
0

To list all cron jobs for a user:

crontab -u <user> -l

To list all cron jobs for root:

crontab -l
user1766169
  • 1,932
  • 3
  • 22
  • 44