Sign inSign up

dharmeshmp/rclone-copy-cron

By dharmeshmp

•Updated almost 2 years ago

Image
0

1.0K

dharmeshmp/rclone-copy-cron repository overview

⁠rclone-copy-cron

A lightweight and flexible Docker image to schedule file copy operations using Rclone with cron. Perfect for automating cloud storage management across multiple providers.


⁠🌟 Features

  • Scheduled File Operations: Automate file transfers with cron expressions for precise scheduling.
  • Multi-Cloud Compatibility: Works seamlessly with all Rclone-supported providers (AWS S3, Google Drive, DigitalOcean Spaces, etc.).
  • Configurable Time Zone: Set your desired time zone with the TIME_ZONE variable for accurate cron scheduling.
  • Real-Time Logging: View logs in the Docker container terminal or access them at /var/log/copy.log for detailed insights.
  • Customizable Rclone Options: Add Rclone-specific options using the RCLONE_OPTIONS variable for maximum flexibility.

⁠🛠️ Usage

⁠1. Environment Variables
VariableRequiredDescriptionExample
RCLONE_SOURCE✅Source location in Rclone format.source:my-bucket-name/path
RCLONE_DESTINATION✅Destination location in Rclone format.backup:my-backup-bucket/path
RCLONE_OPTIONS✅Additional options for the rclone command.--progress --checksum
BACKUP_CRON✅Cron expression to schedule the copy operation.0 2 * * *
TIME_ZONE❌Set the time zone for cron scheduling. Defaults to UTC.Asia/Kolkata
RCLONE_CONFIG_*✅Rclone-specific environment variables to configure cloud providers (e.g., RCLONE_CONFIG_SOURCE_*).See Rclone documentation.

⁠2. Run with Docker
docker run -d \
  -e RCLONE_SOURCE=source:my-source-bucket \
  -e RCLONE_DESTINATION=backup:my-destination-bucket \
  -e RCLONE_OPTIONS="--progress --checksum" \
  -e BACKUP_CRON="0 2 * * *" \
  -e TIME_ZONE="Asia/Kolkata" \
  -e RCLONE_CONFIG_SOURCE_TYPE=s3 \
  -e RCLONE_CONFIG_SOURCE_PROVIDER=AWS \
  -e RCLONE_CONFIG_SOURCE_ACCESS_KEY_ID=your-access-key \
  -e RCLONE_CONFIG_SOURCE_SECRET_ACCESS_KEY=your-secret-key \
  rclone-copy-cron

⁠3. Docker Compose Example
version: "3.9"
services:
  backup:
    image: rclone-copy-cron
    environment:
      - RCLONE_SOURCE=source:my-source-bucket
      - RCLONE_DESTINATION=backup:my-destination-bucket
      - RCLONE_OPTIONS=--progress --checksum
      - BACKUP_CRON=0 2 * * *
      - TIME_ZONE=Asia/Kolkata
      - RCLONE_CONFIG_SOURCE_TYPE=s3
      - RCLONE_CONFIG_SOURCE_PROVIDER=AWS
      - RCLONE_CONFIG_SOURCE_ACCESS_KEY_ID=your-access-key
      - RCLONE_CONFIG_SOURCE_SECRET_ACCESS_KEY=your-secret-key

⁠📜 Logs

  • Real-time logs are displayed in the container terminal.
  • Logs are saved at /var/log/copy.log inside the container for persistent access.

⁠🤝 Contributing

We welcome contributions! Feel free to submit issues or pull requests on the GitHub repository⁠.


⁠📖 Documentation

Check out the complete documentation on the GitHub repository⁠.


⁠🎯 About

rclone-copy-cron simplifies the automation of file copy operations using Rclone and cron, making it ideal for backups, migrations, and large-scale data synchronization across various cloud platforms.

Tag summary

Content type

Image

Digest

sha256:1c1dc18c1…

Size

26.6 MB

Last updated

almost 2 years ago

docker pull dharmeshmp/rclone-copy-cron