1834190 Members
2709 Online
110064 Solutions
New Discussion

Crontab

 
kamal_9
Super Advisor

Crontab

I want to execute a script on every friday at 2am..
how can i achive that using crontab
i made the entries like this .but its not even executing ..i added teh user name in cron.allow also .. i can able to run the script manually
entries i made in crontab
0 2 * * 5 /hoem/admin/test.sh
but its not even executing the script .
crontab daemon is running


11 REPLIES 11
Keith Bryson
Honored Contributor

Re: Crontab

Hi

Is the path a typo? You have typed /hoem/admin/test.sh.

You may want to check the permissions on this file - should be something like rwxr--r--.

Keith
Arse-cover at all costs
kamal_9
Super Advisor

Re: Crontab

sorry the path i entered in the server is correct
/home/admin/test.sh
i had given chmod 777 test.sh
kamal_9
Super Advisor

Re: Crontab

is that timing which i made is correct
Robert-Jan Goossens_1
Honored Contributor

Re: Crontab

How did you edit the cron file ?

# crontab -e

or vi ?

Regards,
Robert-Jan

Keith Bryson
Honored Contributor

Re: Crontab

Hi

Do you see the job starting in /var/adm/cron/log? Try this:

grep "test.sh" /var/adm/cron/log

Keith
Arse-cover at all costs
kamal_9
Super Advisor

Re: Crontab

Hi
i used crontab -e only
and cross checked by crontab -l
kamal_9
Super Advisor

Re: Crontab

no keith as i mentioned earlier the job is not getting started
Iam having some more jobs working fine .
so that i want to confirm the timings
Keith Bryson
Honored Contributor

Re: Crontab

Are you able to run the job interactively (i.e. manually at a Unix prompt, as the user)?

Keith
Arse-cover at all costs
Keith Bryson
Honored Contributor

Re: Crontab

Your syntax looks fine. I seem to remember experiencing something similar before. Have a look at the user's crontab in /usr/spool/cron/crontabs. Is this the correct version? Try:

/sbin/init.d/cron stop
then
/sbin/init.d/cron start

Keith
Arse-cover at all costs
Keith Bryson
Honored Contributor

Re: Crontab

One more thing. Try:

crontab -l >mycrontab
cat -v mycrontab

This will display any dodgy characters that may have been introduced during the edit.

Keith
Arse-cover at all costs
kamal_9
Super Advisor

Re: Crontab

Hi guys sorry
I was wrong .I have not checked the logs properly