I tried to set up a cronjob on my server. Actually this command should execute a java programm every hour. But somehow this didn't worked. I googled and tried to set up a test-script that should run every minute so I could see if my cronjob works.
If I execute the script from the shell there is no problem.
ps ax| grep cron
prints the following
1147 ? Ss 0:00 cron
13940 pts/0 S+ 0:00 grep --color=auto cron
my crontab -l:
# m h dom mon dow command
30 * * * * root java -jar -Xss100m /home/crawler/WebCrawler.jar
1 * * * * root /home/crawler/test.sh
the test.sh:
#!/bin/bash
echo "this is a test " >> test.txt
Does anyone got an idead whats maybe wrong with my system and the crontabs i set up? Its an ubutnu 10.04 server (because the hoster I use got problems with his virtualization and due to that 10.04 is the only version that runs the jvm properly :/)
-Xssparameter stands for? :) – Andrew Logvinov Dec 6 '12 at 8:46test.shcron execute as expected. I guess you need to remove therootword from the start of command. Never seen that before. – mtk Dec 6 '12 at 8:51-xssset a stack size for the thread.test.shexecute as expected if I start it from the shell with./test.sh. I removed the root from the crontab but it still does not execute. – Ogofo Dec 6 '12 at 8:59test.shbecause there is no mail mentioning this file. But it got problems with the java command. It feels like the cronjob is not executing the process in the/home/crawler/directory. The crontab is unable to find the COnfig.cfg the java programm needs and which is in then/home/crawler/directory and it is not able to execute casperjs which ia dded to the path via my bashrc. Some ideas? – Ogofo Dec 6 '12 at 9:17