issue with running script with crontab

I am facing a strange issue while running a script(eg A) from the crontab entry
the script calls one more script(eg B) within it
now when i run the script A manually(with nohup) it also executes the script B (embedded inside it) as expected.

but when i run the script A from the crontab entry it runs the script A,
it also executes all the statements above and below the call to script B
but does not executes script B

Please Advice and let me know if more details are needed

is this a root crontab?

what file permisions do you have on file A and file B.

yes the crontab is root and i am having 777 file permissions for both

777 is bad for security but good for de-bugging :slight_smile:

are you calling file B with full path?
or assumeing a PATH has been set?

The script B lies in /xyz/abc directory

i am changing the directory to /xyz/abc in script A
and then calling the script B

please post both scripts so we don't need to guess.

I would bet for a path problem as suggested above. The best way to troubleshoot a cron problem is to redirect the STDERR to a file or active TTY:

* * * * * /full/path/to/script 2> /tmp/cron_err

Thanks!! indeed it turned out to be a PATH issue,
I gave the full path in the script A to call script B and it worked.
Although just curious why changing to the directory to place of script B didn't worked.