3 From the duplicate question.
source | link

I was trying to run one of the scripts (for example, wrapper.sh) which internally executes other scripts using crontabcrontab. It works fine without any issues.

When iI have created a environment file (which stores the passwords-DB and paths) and trying to execute the main script (wrapper.sh) the croncron entry doesn't work on those scripts which are called internally in the wrapper.

NOTE: I I tried changing PATH,PATH, added env file location before the script in croncron but it still didn't work:

9 9 * * * . /$SOMEPATH/some.env; /path/to$SOMEPATH/wrapper.sh

The environment script and wrapper.sh are in same path. when the cron runs it passes the env variables to wrapper but not to the scripts which are called internally in wrapper. Also a mail is received on /var/mail/$user saying the env file as "No such file or Directory". I've gone through many posts but couldn't figure out the resolution.

I was trying to run one of the scripts (for example, wrapper.sh) which internally executes other scripts using crontab. It works fine without any issues.

When i have created a environment file (which stores the passwords-DB and paths) and trying to execute the main script (wrapper.sh) the cron entry doesn't work on those scripts which are called internally in the wrapper.

NOTE: I tried changing PATH, added env file location before the script in cron but it still didn't work:

9 9 * * * . /$SOMEPATH/some.env; /path/to/wrapper.sh

I was trying to run one of the scripts (for example, wrapper.sh) which internally executes other scripts using crontab. It works fine without any issues.

When I have created a environment file (which stores the passwords-DB and paths) and trying to execute the main script (wrapper.sh) the cron entry doesn't work on those scripts which are called internally in the wrapper.

NOTE: I tried changing PATH, added env file location before the script in cron but it still didn't work:

9 9 * * * . /$SOMEPATH/some.env; /$SOMEPATH/wrapper.sh

The environment script and wrapper.sh are in same path. when the cron runs it passes the env variables to wrapper but not to the scripts which are called internally in wrapper. Also a mail is received on /var/mail/$user saying the env file as "No such file or Directory". I've gone through many posts but couldn't figure out the resolution.

2 Formatting
source | link

I was trying to run one of the scripts  (ex: wrapper.shfor example, wrapper.sh) which internally executes other scripts using crontabcrontab. It works fine without any issues.

When i have created a environment file (which stores the passwords-DB and paths) and trying to execute the main script  (wrapperwrapper.sh) the croncron entry doesn't work on those scripts which are called internally in the wrapper.

NOTE: I tried changing PATH,PATH, added env file location before the script in cron(i.e. 9 9 * * * . /$SOMEPATH/some.env; /path/to/wrapper.sh)cron but it still didn't work.:

9 9 * * * . /$SOMEPATH/some.env; /path/to/wrapper.sh

I was trying to run one of the scripts(ex: wrapper.sh) which internally executes other scripts using crontab. It works fine without any issues.

When i have created a environment file (which stores the passwords-DB and paths) and trying to execute the main script(wrapper) the cron doesn't work on those scripts which are called internally in wrapper.

NOTE: I tried changing PATH, added env file location before the script in cron(i.e. 9 9 * * * . /$SOMEPATH/some.env; /path/to/wrapper.sh) but it still didn't work.

I was trying to run one of the scripts  (for example, wrapper.sh) which internally executes other scripts using crontab. It works fine without any issues.

When i have created a environment file (which stores the passwords-DB and paths) and trying to execute the main script  (wrapper.sh) the cron entry doesn't work on those scripts which are called internally in the wrapper.

NOTE: I tried changing PATH, added env file location before the script in cron but it still didn't work:

9 9 * * * . /$SOMEPATH/some.env; /path/to/wrapper.sh
1
source | link

Environment variables are not passed to sub scripts while running on crontab

I was trying to run one of the scripts(ex: wrapper.sh) which internally executes other scripts using crontab. It works fine without any issues.

When i have created a environment file (which stores the passwords-DB and paths) and trying to execute the main script(wrapper) the cron doesn't work on those scripts which are called internally in wrapper.

NOTE: I tried changing PATH, added env file location before the script in cron(i.e. 9 9 * * * . /$SOMEPATH/some.env; /path/to/wrapper.sh) but it still didn't work.