Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Why don't cron jobs, that I have made in cPanel, show up when I use PuTTy and type crontab -l?

share|improve this question

migrated from stackoverflow.com Jan 28 '11 at 21:59

This question came from our site for professional and enthusiast programmers.

add comment

4 Answers

up vote 1 down vote accepted

Each user on a system has the potential to schedule cron jobs. In other words, there can be many separate sets of cron jobs.

Try ls /var/spool/cron to see a list of users with scheduled jobs.

If the job you scheduled was a script named foo, try grep -l foo /var/spool/cron/* to find out which user scheduled it.

The crontab command has a -u option to specifiy the user. You can use this to view the jobs created in cPanel.

You most likely need to be logged on as root or use sudo.

share|improve this answer
add comment

Supposing the user of whm or host is ashkany, try:

cd /var/spool/cron
dir 

See user --> my user is ashkany:

nano ashkany

Change something and save it.

Same: (run just in 1:23 min every night)

1 23 * * * /usr/local/bin/php/ -p /home/ashkany/public_html/cron.php

(run every 30 min)

*/30 * * * /usr/local/bin/php/ -p /home/ashkany/public_html/30.php
share|improve this answer
add comment

Have no idea why they are not visible there. Under putty just add them by:

crontab -e
share|improve this answer
add comment

The first thing I can think of would be to check the user for whom the cron was created for. You won't see the crontab if you aren't logged in as the same user the crontab was created for in cpanel.

I have never used cpanel, so I don't know if there's an option to create crons for different user or whatnot, so forgive me if I'm off base with this one.

Good luck!

share|improve this answer
    
I guess your right about it being a user issue. because if i add the jobs through cpanel they work but if i add the exact same line of code via putty it doesn't work. –  Anonymous Jan 28 '11 at 20:48
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.