Skip to content
Advertisement

Bash Script Unstable Result

I have bash script and I put in the crontab. It runs every 10 minutes. When I run it manually, it gives perfect results. It creates “.tmp” files and these “.tmp” files are not empty, but Crontab results are not as I expected. it only creates “.tmp” files. Contents of “.tmp” files are empty. In this computer there more than one user. Could it be user privilege issue? What could be the main reason?

Thanks in advance..

Sorry, I forgot 🙂 my code.

JavaScript

and

my crontab is

00,10,20,30,40,50 * * * * ksh /export/GoldenGate/scripts/check.sh 2>/dev/null

Advertisement

Answer

It’s possible that your:

JavaScript

which you call from

JavaScript

requires some environment variables from the user you are running it as. To see if this is the issue, please modify the crontab entry like so:

JavaScript

The

JavaScript

sources the environment variables from your “.bashrc” file.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement