We have two Linux servers running with the same application and infrastructure/middleware setup (test and production), I want to run a health check program as a cron job every 2 minutes on server A like it already dose on server B.
What did I copy is the script from the sever B, implemented the script in the same directory in server A and added the job to Cron using crontab -e
:
*/2 * * * * /opt/xxxx.sh arg1 arg2 >> test.txt 2>>err.txt
The output commands are just to see if the cron kicks the job.
The line which I added on crontab runs as expected individually on command line but it doesn’t execute as a cron job. When I added another job to cron (echo >> test.txt kind of thing
), then it worked just fine.
- I changed the permission of the script to 755,
- When I exit the crontab editor it confirms the new installation.
- I have tried rebooting the server several times.
What do you think can I do more to make the health check run as a cron job?
There’s no output in /var/log/cron
.
—————————————————
Dear Martin Wood Thank you. The program is written in Java but then it’s the shell script that runs the health check. I get no output by running: run-parts /etc/cron.hourly -v —————————————————