2025-02-25 10:20:32 +00:00
2025-02-25 10:18:02 +00:00
2025-02-25 10:18:02 +00:00
2025-02-21 14:54:03 +00:00

📌 How to Use

1️⃣ Create the Directory List File

Example: /opt/AZURE/dir2sync_list

/opt/AZURE/BLOB > testcontainer115
/opt/AZURE/OTHERBLOB > testcontainer115b
/opt/AZURE/EXTRABLOB > testcontainer_extra

2️⃣ Run the Script

./run_azcopy.sh /opt/AZURE/dir2sync_list true 20
  • true → Enables logging.
  • 20 → Limits bandwidth to 20 Mbps.

3️⃣ Cron Job (Runs Every Hour)

0 * * * * /opt/AZURE/run_azcopy.sh /opt/AZURE/dir2sync_list true 20

✅ Key Features

✅ Prevents multiple instances using a lock file (/tmp/run_azcopy.lock).
✅ Reads a file with directory-to-container mappings.
✅ Validates each source directory before syncing.
✅ Checks if the destination container exists (test write).
✅ Stops immediately on any error (clean runs only).
✅ Monitors azcopy every 30 seconds and stops if business hours begin.
✅ Processes all directories sequentially using an array (fixing loop issue).
✅ Uses one log file for the entire run.

S
Description
Script to run M$ azcopy tool on Linux to sync files into AZURE blob storage.
Readme
53 KiB
0 Stars 1 Watchers 0 Forks
Languages
Shell 100%