bash - Cron Job with Java.jar creates no File -


i have simple java application on ubuntu 16.04 server. application generates prices.txt file. file generated if start directly with:

java -jar tankstellenlogger.jar 

if schedule cron doesn´t create file , have no idea why? file running because in cron see log.txt want have other output, thats not all.

crontab -e

# m h  dom mon dow   command * * * * * /home/dominik/startlogger.sh > /home/dominik/log.txt 

startlogger.sh

#!/bin/bash java -jar /home/dominik/tankstellenlogger.jar 

"prices.txt" possibly being written directory other you're expecting. try adding bottom of "startlogger.sh":

pwd ls prices.txt 2>&1 

that should print working directory "/home/dominik/log.txt" check whether "prices.txt" there. if info doesn't show in "log.txt", may permissions problem.


Comments

Popular posts from this blog

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -

python - Error while using APScheduler: 'NoneType' object has no attribute 'now' -