This lightweight Docker container allows you to automatically download or upload files and directories over SFTP from multiple remote servers using a configurable schedule or immediate execution.
Built with Alpine Linux + LFTP, it supports both password and SSH key authentication and organizes transfers into host-specific folders. Perfect for automated backup or synchronization.
download, upload)docker run --rm \
-e TIMEZONE=Europe/Berlin \
-e LOG_LEVEL=INFO \
-e RETENTION_DAYS=7 \
-v $(pwd)/config:/config \
-v $(pwd)/data:/data \
-v $(pwd)/logs:/logs \
saygonka/sftpclient
To schedule the backup (e.g., every day at 3 AM):
docker run --rm \
-e TIMEZONE=Europe/Berlin \
-e BACKUP_SCHEDULE="0 3 * * *" \
-e LOG_LEVEL=INFO \
-e RETENTION_DAYS=7 \
-v $(pwd)/config:/config \
-v $(pwd)/data:/data \
-v $(pwd)/logs:/logs \
saygonka/sftpclient
Create a servers.txt file in the mounted /config directory with the following format:
host,port,user,password,remote_dir,local_dir,is_directory,use_ssh,key_content,mode
Example:
test.rebex.net,22,demo,password,/readme.txt,/data,false,false,,download
example.com,22,user,,/remote-dir,/data,true,true,<SSH_KEY_CONTENT>,upload
For each host and mode, files will be placed under:
/data/{hostname}/{download|upload}
Content type
Image
Digest
sha256:0357cd663โฆ
Size
9 MB
Last updated
over 1 year ago
docker pull saygonka/sftpclient