0
votes

Thanks in advance, I'm creating a copy solution using PowerShell and will put the PS file in task scheduler. This PS file will contain azcopy cmdlet. I want to make sure my script runs fine even in the middle of copy and server crashed then at the next schedule run my azcopy script should run and shouldn't fail because of the below reason.

I've one concern with azcopy. When i start copying of data and press ctrl + C OR my machine is restarted in the middle of copy. azcopy journal file is stuck AzCopy.jnl & AzCopyCheckpoint.jnl are the 2 files which is corrupted and stuck. We have to delete the files and then the next azcopy completes when i delete it until then no further azcopy will complete. azcopy parameter which I'm currently using is to only copy new files is mentioned below

azcopy.exe /Source:E:\Datatesting\ /Dest:$deststorageaccount /DestKey:$Destkey /S /XO /XN

So what I'm thinking is to delete all the files inside the azcopy journal folder before my script runs.

Q1. ) so deleting the journal file if it is present, is it supported what I'm trying to do? as my azcopy command checks for /XO and /XN and only copy the files which are not present on azure blob then it shouldn't matter if azcopy doesn't finds any actual failed job with help of journal file

Get-ChildItem -Path C:\Users\username\AppData\Local\Microsoft\Azure\AzCopy -Include *.* -File -Recurse | foreach { $_.Delete()}
2

2 Answers

2
votes

Have tried v10 which went GA recently and this issue is not seen.

0
votes

I'm wondering what you meant by corrupted and stuck? It's not expected that Ctrl + C will corrupt the journal files of AzCopy. Is stuck just due to a confirmation prompt about whether to leverage the existing journal files detected? If that's the case, you can specify /Y in the AzCopy command line to suppress the prompt directly.