Monday 15 April 2013

java - Jar cron job not running (runs manually) -



java - Jar cron job not running (runs manually) -

first time using cron jobs , im relatively new linux , cant seem work, works fine if manually run in command line not cron job.

i set this:

contrab -e insert mode */3 * * * * root (cd /home/ec2-user/; java -jar feedpuller-1.jar) (every 3 minutes test) save , quit it says has created new cron job tab

now when crontab -l job there, , when simple command "cd /home/ec2-user/; java -jar feedpuller-1.jar" runs , when check cron log in /var/log/ has

oct 10 00:30:34 ip-172-31-29-33 crontab[28934]: (root) begin edit (root) oct 10 00:33:25 ip-172-31-29-33 crontab[28934]: (root) replace (root) oct 10 00:33:25 ip-172-31-29-33 crontab[28934]: (root) end edit (root) oct 10 00:33:48 ip-172-31-29-33 crontab[28937]: (root) list (root) oct 10 00:34:01 ip-172-31-29-33 crond[28932]: (root) bad file mode (/etc/cron.d/0hourly) oct 10 00:34:01 ip-172-31-29-33 crond[28932]: (root) bad file mode (/etc/cron.d/update-motd) oct 10 00:36:01 ip-172-31-29-33 crond[28942]: (root) cmd (root (cd /home/ec2-user/; java -jar feedpuller-1.jar)) oct 10 00:39:01 ip-172-31-29-33 crond[28949]: (root) cmd (root (cd /home/ec2-user/; java -jar feedpuller-1.jar)) oct 10 00:42:01 ip-172-31-29-33 crond[29041]: (root) cmd (root (cd /home/ec2-user/; java -jar feedpuller-1.jar))

so means running right? when check local database (that jar should writing to) nil beingness written (if run jar cd /home/ec2-user/; java -jar feedpuller-1.jar writes database no problem)

apologies, lack of understanding of cron jobs , linux in general causing me create basic error.

in cron tab ive changed to

*/30 * * * * java -jar /home/ec2-user/feedpuller-1.jar

and working fine

java jar amazon-ec2 cron

No comments:

Post a Comment