Sign inSign up

milligram/daily-webdav-sync

By milligram

Updated over 1 year ago

Lightweight tool for one-way/two-way WebDAV sync with file filtering and scheduling.

Image
Networking
Integration & delivery
Databases & storage
0

760

milligram/daily-webdav-sync repository overview

Daily WebDAV Sync

A lightweight, Dockerized tool for synchronizing directories using WebDAV. Supports one-way and two-way sync, daily scheduled runs, file type filtering, and manual execution.


Features

  • Flexible Sync Options:
    • remote-to-local, local-to-remote, or two-way synchronization.
  • Automated or Manual Execution:
    • Schedule daily syncs or run tasks on demand.
  • File Type Filtering:
    • Include or exclude specific file types during sync.
  • Lightweight & Secure:
    • Runs in a Docker container using a non-root user for enhanced security.

How It Works

Sync Modes
  • remote-to-local: Download files from a remote WebDAV directory to a local directory.
  • local-to-remote: Upload files from a local directory to a remote WebDAV directory.
  • two-way: Synchronize both directories to ensure consistency.
File Filters
  • INCLUDE_FILE_TYPES: Process only specified file types.
  • EXCLUDE_FILE_TYPES: Skip specified file types.
  • If both are empty, all files are processed.

Configuration

The tool is configured using environment variables:

VariableDescriptionExample Value
WEBDAV_HOSTNAMEWebDAV server URLhttps://example.com
WEBDAV_LOGINWebDAV usernameyour-username
WEBDAV_PASSWORDWebDAV passwordyour-password
REMOTE_DIRRemote directory to sync/remote/folder/
LOCAL_DIRLocal directory for syncing/path/to/local/dir
SYNC_MODESync mode: remote-to-local, local-to-remote, or two-waytwo-way
SCHEDULED_TIMETime for daily scheduled sync (24-hour format)02:00
RUN_MODEmanual for immediate sync or scheduled for daily syncmanual
INCLUDE_FILE_TYPESComma-separated list of file extensions to includemp4,srt
EXCLUDE_FILE_TYPESComma-separated list of file extensions to excludetmp,log

Usage

Running with Docker
1. Build the Docker Image:
docker build -t daily-webdav-sync .
2. Run the Container:

Replace <variables> with your values:

sudo docker run -d \
    --name daily-webdav-sync \
    -e WEBDAV_HOSTNAME=https://your-webdav-server.com \
    -e WEBDAV_LOGIN=<your-login> \
    -e WEBDAV_PASSWORD=<your-password> \
    -e REMOTE_DIR=/path/to/remote/dir/ \
    -e LOCAL_DIR=/mnt/local-sync/ \
    -e SYNC_MODE=remote-to-local \
    -e RUN_MODE=scheduled \
    -e SCHEDULED_TIME=02:00 \
    -e TZ=Europe/Stockholm \
    -e INCLUDE_FILE_TYPES=mp4,srt,txt \
    -e EXCLUDE_FILE_TYPES=tmp,log \
    -v /your/local/directory:/mnt/local-sync \
    milligram/daily-webdav-sync:latest
3. Check Logs: View the container logs for sync updates:

docker logs daily-webdav-sync

Tag summary

Content type

Image

Digest

sha256:12985df18

Size

50.4 MB

Last updated

over 1 year ago

docker pull milligram/daily-webdav-sync