Containerized solution to backup local files to object storage. Supports three modes:
* sync - synchronizes source directory with backup target directory
* full - uploads source directories' content to timestamped folders in backup target directory
* archive - creates timestamped archives of every source directory and uploads them to backup target directory

Uses RClone to transfer backups to provide support for a variety of object storage options.

NOTE: when using archive backup mode, the solution stores archive in the filesystem before uploading them to the Object Storage. For big files, consider mounting a temporary storage of sufficient size as /srv directory in the container

Log in to Corewide container registry

Once you have a Corewide Solutions Portal account, get your registry password here and use it to log in via CLI:

 shelldocker login oci.corewide.com
Download the image

Pull the image from the registry to your machine:

 shelldocker pull oci.corewide.com/docker/file-backup:1.0.1

File Backup

File backup solution
$800
40% off
$480
Deploy to Kubernetes BUY
1.0.1 released 1 month, 2 weeks ago
New version approx. every 12 weeks

Containerized solution to backup local files to object storage. Supports three modes:
* sync - synchronizes source directory with backup target directory
* full - uploads source directories' content to timestamped folders in backup target directory
* archive - creates timestamped archives of every source directory and uploads them to backup target directory

Uses RClone to transfer backups to provide support for a variety of object storage options.

NOTE: when using archive backup mode, the solution stores archive in the filesystem before uploading them to the Object Storage. For big files, consider mounting a temporary storage of sufficient size as /srv directory in the container

For docker-compose setup, put your environment variables in backup.env and use docker compose to run the container:

 iniSTORAGE_TYPE=s3
STORAGE_BUCKET_NAME=backups
STORAGE_ENDPOINT=fra1.digitaloceanspaces.com
STORAGE_SECRET_ACCESS_KEY=<secret-key>
STORAGE_ACCESS_KEY_ID=<access-key>
BACKUP_MODE=archive
BACKUP_SOURCE_DIRECTORIES=/media
BACKUP_TARGET_DIRECTORY=myapp-backups
RETENTION_PERIOD_DAYS=7

An example docker-compose.yml file with predefined options to run as a one-shot container triggered by a cron job:

 yamlservices:
  file-backup:
    image: oci.corewide.com/docker/file-backup:1.0.1
    container_name: file-backup
    env_file: backup.env
    restart: no
    volumes:
      - "/media:/media"

And then run the following command:

 bashdocker compose up -d

To run the container using a cron job create a job with this content:

 cron0 0 * * * root docker compose -f /path/to/docker-compose.yml up

An example of a Docker command to run one-time backup of /media/ and /video/ to DigitalOcean Spaces bucket as backups/myapp-backups/media-YYYYMMDDHHMMSS and backups/myapp-backups/video-YYYYMMDDHHMMSS:

 bashdocker run --rm \
    -e STORAGE_TYPE=s3 \
    -e STORAGE_BUCKET_NAME=backups \
    -e STORAGE_ENDPOINT=fra1.digitalocean.com \
    -e STORAGE_SECRET_ACCESS_KEY=<secret-key> \
    -e STORAGE_ACCESS_KEY_ID=<access-key> \
    -e BACKUP_MODE=archive \
    -e BACKUP_SOURCE_DIRECTORIES=/media,/videos \
    -e BACKUP_TARGET_DIRECTORY=myapp-backups \
    -e RETENTION_PERIOD_DAYS=7 \
    -v ./media:/media \
    -v ./videos:/videos \
    hub.corewide.com/lib/file-backup:latest

For docker-compose setup, put your environment variables in backup.env and use docker compose to run the container:

 iniSTORAGE_TYPE=s3
STORAGE_BUCKET_NAME=backups
STORAGE_PROVIDER=AWS \
STORAGE_REGION=us-east-1 \
STORAGE_ACCESS_KEY_ID=xxxx \
STORAGE_SECRET_ACCESS_KEY=yyyy \
STORAGE_BUCKET_NAME=my-backups \
BACKUP_MODE=archive
BACKUP_SOURCE_DIRECTORIES=/media
BACKUP_TARGET_DIRECTORY=myapp-backups
RETENTION_PERIOD_DAYS=7

An example docker-compose.yml file with predefined options to run as a one-shot container triggered by a cron job:

 yamlservices:
  file-backup:
    image: oci.corewide.com/docker/file-backup:1.0.1
    container_name: file-backup
    env_file: backup.env
    restart: no
    volumes:
      - "/media:/media"

And then run the following command:

 bashdocker compose up -d

To run the container using a cron job create a job with this content:

 cron0 0 * * * root docker compose -f /path/to/docker-compose.yml up

An example of a Docker command to run one-time backup of /media/ and /video/ to AWS S3 bucket as backups/myapp-backups/media-YYYYMMDDHHMMSS and backups/myapp-backups/video-YYYYMMDDHHMMSS:

 bashdocker run --rm \
    -e STORAGE_TYPE=s3 \
    -e STORAGE_BUCKET_NAME=backups \
    -e STORAGE_PROVIDER=AWS \
    -e STORAGE_REGION=us-east-1 \
    -e STORAGE_ACCESS_KEY_ID=xxxx \
    -e STORAGE_SECRET_ACCESS_KEY=yyyy \
    -e STORAGE_BUCKET_NAME=my-backups \
    -e BACKUP_MODE=archive \
    -e BACKUP_SOURCE_DIRECTORIES=/media,/videos \
    -e BACKUP_TARGET_DIRECTORY=myapp-backups \
    -e RETENTION_PERIOD_DAYS=7 \
    -v ./media:/media \
    -v ./videos:/videos \
    hub.corewide.com/lib/file-backup:latest
Variable Description Default Required Sensitive
BACKUP_MODE Backup mode. Allowed values: sync (synchronizes source directory with backup target directory), archive (creates timestamped archives of every source directory and uploads them to backup target directory), full (uploads source directories' content to timestamped folders in backup target directory) archive no no
BACKUP_SOURCE_DIRECTORIES String that contains comma-delimited list of paths (both relative and absolute) to backup. If BACKUP_MODE is sync, must contain only one item. Paths containing spaces are not supported yes no
BACKUP_EXCLUDE_PATHS String that contains comma-delimited list of paths (relative to source directories) to exclude from backup. Paths containing spaces are not supported "" no no
STORAGE_TYPE Type of the object storage to use for storing backups. Use local to copy files to local filesystem yes no
STORAGE_BUCKET_NAME Name of the object storage bucket to upload the backups to. Is not required if local or any other STORAGE_TYPE is used other than s3 yes no
STORAGE_BUCKET_DIR Directory of storage bucket (or local filesystem if STORAGE_TYPE is s3) to store the backup files in. If BACKUP_MODE is archive, stores archives. If full, stores folders. If sync, stores synced files no no
STORAGE_ENV_AUTH Consume storage credentials from cloud-native environment variables false no no
STORAGE_* Options to translate as RClone environment variables (will be translated as RCLONE_CONFIG_BACKUP_* params) no possibly
DEBUG Enable debug output false no no
RETENTION_PERIOD_DAYS Maximum allowed backup files' age in days. If not set, retention will be skipped and no backup files or folders will be deleted no no

These components are included as is under the terms of their corresponding licenses.

Component License
RClone MIT

References

RClone general settings:

RClone settings for popular object storage providers:

Not sure where to start?
Let's find your perfect match.