Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

After sudo crontab -e (it wrote "/tmp/crontab.XXXX70pN9h" 1L, 19C 1,1 All

Then I saved the file. And to check..? (how? i don't know)

And to check I 
ps -e | grep cron
29818 ?        00:00:00 cron

So.. but I decided to check again but

sudo cat /etc/cron.hourly
cat: /etc/cron.hourly: Is a directory
xi@localhost ~ $ sudo ls /etc/cron.hourly

Nothing! i.e. in directory

As I understand first 0 in the hour-position means every hour?

share|improve this question
    
I don't know( thanks for -1((( –  Xsi Nov 9 '12 at 13:15
    
Ok, I'll wait for an hour (the most lessest gap in documentation) –  Xsi Nov 9 '12 at 13:17
    
You definitely want to check a question of mine. It has an answer by Stephane Chazelas that explains how you can create an interactive shell that is identical to the environment your cron job will see. If you walk through his little procedure, you get a prompt and you can test your cronjob step by step and see where it fails. unix.stackexchange.com/a/56503/16841 Sure it isn't a 100% match for your question, but it can help you troubleshoot crontab issues. –  jippie Nov 23 '12 at 22:56
add comment

3 Answers 3

Your crontab and cron.hourly are separate entities. Putting something in your crontab does not put it in cron.hourly, even if it runs every hour. Putting a script in cron.hourly is merely another way of having it run every hour, that is, your cron daemon checks both your crontab and cron.hourly. Having it in both would run it twice.

share|improve this answer
    
Fri Nov 9 15:16:01 EET 2012 xi@localhost ~ $ ls /var/log/cron.log ls: cannot access /var/log/cron.log: No such file or directory –  Xsi Nov 9 '12 at 13:21
    
@Xsi What's your point? –  Chris Down Nov 9 '12 at 13:39
add comment

You can check if the crontab is installed using:

sudo crontab -l

Every hour a log message should appear in /var/log/syslog that it was executed.

Further reading:

http://www.linuxweblog.com/crotab-tutorial

I tink that the first zero (0) is the minutes. But if you say you want something done when the minutes is 0 it would be performed every hour. As only once an hour the minutes are zero.

share|improve this answer
add comment

The fields in cron are:

m      h       dom             mon     dow          command
Minute Hour    Day of Month    Month   Day of week  <command>

And your 0 * * * * <command> then translates to "Execute command on every hour, every day, every month, and every weekday, if the minute is 0"

You can list your crontab by using crontab -l, as delh already stated.

Take this Link here, there are some Practical Cron Examples

share|improve this answer
    
date [-u|--utc|--universal] [MMDDhhmm[[CC]YY][.ss]] it's like , But visa versa –  Xsi Nov 9 '12 at 17:36
    
What does this have to do with cron? –  Bonsi Scott Nov 9 '12 at 19:36
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.