Rclone Azure Blob
Rclone Azure Blob
Section titled “Rclone Azure Blob”Rclone Azure Blob Storage
Section titled “Rclone Azure Blob Storage”Set up Azure storage account with all defaults. Then follow the image to get the SAS key.
Installation
Section titled “Installation”Unix-based systems:
curl https://rclone.org/install.sh | sudo bashWindows: Download from https://rclone.org/downloads/
Mounting in Linux
Section titled “Mounting in Linux”Follow directions from https://rclone.org/azureblob/ or reference this video tutorial.
Configuration Steps
Section titled “Configuration Steps”-
Run
rclone config -
Choose the following options:
n- for new remote30- for Azure Blob- Use defaults till you reach
sas_urlthen copy the sas_url for your container
Note: You must create the sas_url from the container NOT the account. Also make sure you give the right permissions.
Example sas_url:
https://storage.blob.core.windows.net/cloud?sp=racwdlmeop&st=2023-07-03T12:41:58Z&se=2027-07-03T20:41:58Z&spr=keyofsomesort- Use defaults to the end and quit the config. You will see something like this:
Configuration complete.Options:- type: azureblob- account: storage- sas_url: "thesasurl"
Keep this "sas" remote?y) Yes this is OK (default)e) Edit this remoted) Delete this remotey/e/d> y
Current remotes:Name Type==== ====sas azureblob
e) Edit existing remoten) New remoted) Delete remoter) Rename remotec) Copy remotes) Set configuration passwordq) Quit confige/n/d/r/c/s/q> qConnection Options
Section titled “Connection Options”Syncing
Section titled “Syncing”Sync a target directory. You will need to set a cron job to back and sync regularly.
rclone sync /home/drok/blob sas:cloud/test# Format: rclone sync /target_directory "remote_name":"container_name"/"directory_in_container"Mounting
Section titled “Mounting”Similar to sync, but the service stays connected.
rclone mount --allow-non-empty sas:teleportcloud/test /home/drok/blob/Running this command in the terminal will remain active. You will need to run this in the background as a service.
Running on Boot
Section titled “Running on Boot”- Create a simple script:
nano rclone_blobmount.sh
#!/bin/bashrclone mount --allow-non-empty --daemon sas:teleportcloud/test /home/drok/blob/- Make it executable:
chmod +x rclone_blobmount.sh- Create a systemd file:
sudo nano /etc/systemd/system/blobmount.service
Description=rclone blobstorage mountAfter=network.targetAfter=systemd-user-sessions.serviceAfter=network-online.target
User=drokType=forkingExecStart=/home/drok/rclone_blobmount.shTimeoutSec=30Restart=on-failureRestartSec=30StartLimitInterval=350StartLimitBurst=10
Alias=blobmount.serviceWantedBy=multi-user.target- Restart systemd daemon:
sudo systemctl daemon-reload- Run the service:
sudo systemctl start blobmount.service- Enable on boot:
sudo systemctl enable blobmount.service