question

JatinmayaChoudhury-1619 avatar image
0 Votes"
JatinmayaChoudhury-1619 asked JatinmayaChoudhury-1619 action

azcopy command inside python script is not working when running from crontab

Hi Team ,
We have a python script which invokes an azcopy command like below

os.system("azcopy copy {} 'https://8f****stg.blob.core.windows.net/dremioprodfs/tables/md/reflection_hist/<SAS Token here>' --recursive=true".format(dest_file))

It works perfectly fine when we directly trigger the python script ,but when we schedule through the crontab it does not work

in the log file we see that
sh: azcopy: command not found

Please provide a solution on this

azure-stack-hub
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

Sumarigo-MSFT avatar image
0 Votes"
Sumarigo-MSFT answered Sumarigo-MSFT edited

@JatinmayaChoudhury-1619 Thanks for raising this question! Firstly, apologies for the delay in responding here and any inconvenience this issue may have caused.

Based on the error message can you, please Try running it by calling it

./azcopy

Can you try to re-generate the New SAS token and try again.
Instead of just azcopy. And make sure your working directory, at the time, is the place where the azcopy executable is. If that doesn't work, please let us know The OS can only find azcopy if it was part of the path. Invoking it with a relative path ./azcopy or absolute path /usr/name/bla/azcopy would be the alternatively way.

If the issue still persists, Can you please share the screenshot of the error message and also the complete code (Hiding the PI data)

Hope this helps!

Kindly let us know if the above helps or you need further assistance on this issue.


Please don’t forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.



5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.