crontab: executing java shell commands for example talend

To run talend scripts on you ubuntu box, you need to add the path on your cron otherwise it will not run. You can see the explanation below, obviously need to change the path with your current java path (mine is ... /usr/lib/jvm/java-8-openjdk-amd64/bin)

An additional note, I made a big mistake, I was going to edit crontab (crontab -e). but hit crontab -r by mistake. This resets your crontab, and deletes this. So if by accident you do this, you need to recreated this steps to have your talend java scripts to run.

 

Check crontab environmental variables

* * * * * env > env_dump.txt

 

less env_dump.txt

HOME=/root
LOGNAME=root
PATH=/usr/lib/jvm/java-8-openjdk-amd64/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
LANG=en_US.UTF-8
SHELL=/bin/sh
PWD=/root

 

Update to Sync them.

# echo PATH=$PATH > tmp.cron
# echo >> tmp.cron
# crontab -l >> tmp.cron
# crontab tmp.cron

Leave a Reply

Your email address will not be published. Required fields are marked *