LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   crontab not working (https://www.linuxquestions.org/questions/linux-general-1/crontab-not-working-358205/)

durgap 08-29-2005 02:25 PM

crontab not working
 
I am a new bie to linux. I had never used cron. I had written simple cron entry
$ crontab -e
1,2,3,4,5,6 * * * * echo "hello ..." >> /home/dp/dp 2>&1

I expect to write this "hello...." message to a file /home/dp/dp 6times every hour, But it does not happen.


Pls help me

Durga.

Tinkster 08-29-2005 02:34 PM

Try

1,2,3,4,5,6 * * * * echo "hello ..." 2>&1 >> /home/dp/dp

If still nothing happens check crons logfiles.


Cheers,
Tink

DeNayGo 08-29-2005 03:09 PM

Well it works on my machine... checked if your cron daemon's running?
Cause when I was new to Linux I didn't even know there was a cron daemon and thus had some problems getting cronjobs to run, too. ^^

durgap 09-01-2005 01:53 AM

Can you give me the details of cron's log files. If
I had executed a job with CRON, Will it log some some info, that it had executed a job at so and so time. like....

kaverong 09-01-2005 03:48 AM

cron logs are located at

/var/log/cron

durgap 09-01-2005 10:26 AM

Before starting my exercise with cron i cleared the contents of /var/log/cron. So that when my job runs it will update the log file, i can easily monitor the log. Now my cron jobs are working, but the /var/log/cron is not being updated. I had restarted the crond daemon. But it still does not update the /var/log/cron.

Pls advise.

Tinkster 09-01-2005 02:38 PM

The alternate way is to have results emailed by
cron ... as root (or the owner of the cronjob) do
a
mail
on the command-line.


Cheers,
Tink


All times are GMT -5. The time now is 11:39 AM.