LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   cron is not working (https://www.linuxquestions.org/questions/linux-software-2/cron-is-not-working-490082/)

somsahi 10-06-2006 02:16 PM

cron is not working
 
I have a script audit.sh in home/wasadmin/jar whose contents are below

#!/bin/sh
/usr/java/j2sdk1.4.2_12/jre1.4.2.12/bin/java -jar /home/wasadmin/jar/AAuditManger.jar
After creating this file i used this command

"chmod +x /home/wasdamin/jar/audit.sh" (use chmod +x audit.sh as u r in curent directory")

Now for cron job
script in home/wasadmin/jar as audit.ct

0-59/3 * * * * home/wasadmin/jar/audit.sh

to add the cron job used
"crontab /home/wasadmin/jar/audit.ct"

but nothing is haapening .any idea.
all three audit.sh ,audit.ct and jar file in same direcotry

ygloo 10-06-2006 02:23 PM

i put files in one of /etc/cron.* dirs.... depends when u wan to start script

somsahi 10-06-2006 02:27 PM

ok i try that and update this thread

somsahi 10-06-2006 02:40 PM

i tried to open file audit.ct in folder mentioned by you but after writing the line whan i try to save it by zz error cannot OPEN FILE FOR WRITING

somsahi 10-06-2006 02:54 PM

i think i have no permission for this folder any how is it possible that when in same directory this cron can be run

ygloo 10-06-2006 03:17 PM

folder permissions should look like this:

drwxr-xr-x 2 root root 4096 2005-04-13 08:31 /etc/cron.daily

somsahi 10-06-2006 03:20 PM

but basic question remain same does it matter if i keep all file in same folder

somsahi 10-06-2006 03:23 PM

i got the exactly same permission that u mentioned

ygloo 10-06-2006 03:32 PM

see - http://www.jalix.org/ressources/linu...vrac/cron.html
it is a good idea to keep files toghether

somsahi 10-06-2006 03:39 PM

YGLOO THAT only I am doing keeping all three files in same directory that is home/wasdmin/jar

but dont know nothing happening

ygloo 10-06-2006 03:48 PM

have to tell crontab username:

crontab -u paul paul.ct

somsahi 10-06-2006 03:49 PM

/bin/sh: home/wasadmin/jar/audit.sh: No such file or directory
I am geting this error but audit.sh is there but dont know y this error

somsahi 10-06-2006 04:09 PM

issue solved cron is running


All times are GMT -5. The time now is 10:58 AM.