Sign inSign up

robhofmann/powershellazurecronblobuploader

By robhofmann

•Updated about 5 years ago

Uploads files to Blob storage & optionally deletes uploaded files

Image
0

860

robhofmann/powershellazurecronblobuploader repository overview

⁠PowershellAzureCronBlobUploader

Powershell script that uploads files to Blob storage & optionally deletes uploaded files

⁠Environment variables needed

Variable nameExample valueDescription
SKIP_DIRECTORIES*something*;anotherSomething*;/data/somesubfolderFolders which you want to skip uploading. Wildcards are permitted. This is an optional parameter.
UPLOAD_CRON_EXPRESSION*/2 * * * *The CRON expression in which frequency to run the script.
STORAGE_ACCOUNT_NAMEmystorageaccountThe Azure StorageAccountname.
STORAGE_ACCOUNT_KEYmOIUoumoimUOImuoyb9696d93q8m9+asd+1f==This accesskey can be found in your storage account under "Access keys".
BLOB_CONTAINER_NAMEmydataThe Blob container name to use.
BLOB_TIERArchiveThe blob tier to use. Options are Hot, Cool, Archive.
GRACE_PERIOD_IN_SECONDS3600Files newer than this grace period will be skipped (both for uploading & deleting). This is usefull for when files are still in use when the upload starts.
DELETE_ON_SUCCESSFUL_UPLOAD1Deletes the local file after upload if 1 (Choose either 1 (true) or 0 (false)).

⁠How to use

  1. Make sure you filled all the above environment variables.
  2. The data to be uploaded should be mounted at /data inside the container.

⁠Example

docker run --name=myuploader -e UPLOAD_CRON_EXPRESSION='*/2 * * * *' -e STORAGE_ACCOUNT_NAME="mystorageaccount" -e STORAGE_ACCOUNT_KEY="mOIUoumoimUOImuoyb9696d93q8m9+asd+1f==" -e BLOB_CONTAINER_NAME="mydata" -e BLOB_TIER="Archive" -e GRACE_PERIOD_IN_SECONDS=3600 -e DELETE_ON_SUCCESSFUL_UPLOAD=1 -v /some/data/path/on/host:/data -d robhofmann/powershellazurecronblobuploader

Tag summary

Content type

Image

Digest

Size

167.4 MB

Last updated

about 5 years ago

docker pull robhofmann/powershellazurecronblobuploader