data Backup

arun kumar 71 Reputation points
2021-08-27T13:08:22.733+00:00

Hi Team

i had installed azcopy in linux VM, then used crontab to automate the file backup daily from linux vm to azure storage account in the root user of the vm with the below command.

0 0 * * * azcopy cp "source path" "storage container url"

when i run manually files are getting uploading to azure storage account but the same command is not working when updated crontab.

created script for the command and updated script file path in the crontab but that also not working to upload data automatically everyday but if run the script manually its uploading the file to azure account.

not getting any errors and the command or script is executing when i checked the logs /var/logs/cron.

Please suggest whether azcopy will supports for auto backup or not. if yes please help me with the procedure.

Regards
Arun C V

Azure Storage Accounts
Azure Storage Accounts
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
2,944 questions
0 comments No comments
{count} votes

Accepted answer
  1. deherman-MSFT 35,636 Reputation points Microsoft Employee
    2021-08-30T20:10:23.8+00:00

    @arun kumar

    Apologies for the delayed response. Try including the full path of azcopy in your crontab to see if that resolves the issue. Such as 0 0 * * * /usr/bin/azcopy cp "source path" "storage container url". There should not be any issue running from crontab as long as you have proper permissions.

    How are you doing authentication? If using a SAS token make sure you escape any "%" characters by adding "\" in front of them. If you are still facing issues please append ">> /var/log/output.log 2>&1" to the end of your crontab and give me the results you are seeing in the output.log

    Hope this helps. Let me know if you are still facing issues or need further assistance.


    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.

    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. arun kumar 71 Reputation points
    2021-08-27T13:10:26.8+00:00

    sorry the above mentioned is not the one i was used and below command is the one i was used.

    0 0 * * * azcopy cp "source path" "storage container url"

    0 comments No comments

  2. arun kumar 71 Reputation points
    2021-09-02T08:32:53.757+00:00

    Hi

    Manually i can able to upload using azcopy from linux VM to azure storage account. To make it automate i had entered the same command format by specifying the time but its not uploading to azure storage account. it's not showing any errors in the logs, crontab command is executing but its not reflecting the azure storage account when the same command if i execute manually then the data gets uploading to azure storage account.

    I need a solution how to automate the process for uploading files to azure storage account regularly.

    Regards
    Arun C V

    0 comments No comments