Sign inSign up

robhofmann/powershellazurecronblobcleaner

By robhofmann

•Updated over 5 years ago

Powershell script that cleans files from Blob storage with a cutoff date.

Image
0

463

robhofmann/powershellazurecronblobcleaner repository overview

⁠PowershellAzureCronBlobCleaner

Powershell script that cleans files from Blob storage with a cutoff date.

⁠Environment variables needed

Variable nameExample valueDescription
CLEAN_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.
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.

⁠How to use

  1. Make sure you filled all the above environment variables.
  2. Run :).

⁠Example

docker run --name=mycleaner -e CLEAN_CRON_EXPRESSION='0 * * * *' -e STORAGE_ACCOUNT_NAME="mystorageaccount" -e STORAGE_ACCOUNT_KEY="mOIUoumoimUOImuoyb9696d93q8m9+asd+1f==" -e BLOB_CONTAINER_NAME="mydata" -e GRACE_PERIOD_IN_SECONDS=3600 -d robhofmann/powershellazurecronblobcleaner

Tag summary

Content type

Image

Digest

Size

164.5 MB

Last updated

over 5 years ago

docker pull robhofmann/powershellazurecronblobcleaner