Date created: Sunday, September 8, 2024 2:49:30 PM. Last modified: Sunday, September 8, 2024 2:57:17 PM

'rclone' Notes

Docker

Generate SSH keys:

ssh-keygen -t ed25519 -f ./

Dockerfile:

$ cat Dockerfile

FROM ubuntu:24.04

RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get -y --no-install-recommends install \
ca-certificates fuse3 gawk git golang-go make openssh-client tzdata

RUN git clone https://github.com/rclone/rclone.git

RUN cd rclone/ && \
make && \
cp rclone /usr/local/bin/ && \
rclone version

# SSH keys are used to decrypt rclone config, not for connecting to remote storage
# (remote crypto storage details are stored in rclone.conf) COPY id_ed25519 /root/.ssh/ COPY id_ed25519.pub /root/.ssh/ RUN chown -R root:root /root/.ssh/ && \ chmod 700 /root/.ssh && \ chmod -R 600 /root/.ssh/*
# Save the SSH key of the remote storage RUN ssh-keyscan -t dsa,rsa,ecdsa,ed25519 remote-server.com > /root/.ssh/known_hosts COPY rclone.conf /root/.config/rclone/rclone.conf RUN chown root:root /root/.config/rclone/rclone.conf && \ chmod 600 /root/.config/rclone/rclone.conf ENTRYPOINT [ "rclone" ]

Docker Compose:

$ cat docker-compose.yaml

services:
rclone:
build:
context: .
dockerfile: Dockerfile
volumes:
- /data/:/data/:ro

Examples

Sync to remote:

docker compose run --rm rclone sync \
--dry-run \
--bwlimit=10M \
--human-readable \
--max-delete=500 \
--progress \
--stats=1m \
--track-renames \
--transfers=2 \
--verbose \
--max-duration=8h \
/data/Backup/ \
remote:Backup/

Get size of remote:

docker compose run --rm rclone size remote:Backup/

 


Previous page: Random Commands
Next page: 'rkhunter' - Notes