A simple service to create backups of SQLite database files by recursively scanning a directory.
1.2K
A simple service to create backups of SQLite database files by recursively scanning a directory and backing up all SQLite database files found to a specified backup directory. It will maintain the same directory structure as the source database files.
I use this as a part of my backup strategy for my self hosted services.
Build the Docker image:
docker build --load -t sqlite-backup:latest .
Run the Docker container:
docker compose up
SOURCE_DIR: Directory to search for SQLite database files
BACKUP_DIR: Directory where backups will be stored
INTERVAL: Backup frequency in hours (e.g. 12, 24) (optional, defaults to 24)
LOGLEVEL: Sets the log level (e.g., info, debug, error) (optional, defaults to info)
Make sure to mount your source and backup directories, see the docker-compose file for an example.
Clone the repository:
git clone https://github.com/bpmb82/sqlite-backup.git
Build the project:
cargo build --release
Run the executable:
./target/release/sqlite-backup <command>
backup: Create a backup of the source directory.restore: Restore backup files to the source directory.daemon: Run the backup service in daemon mode, can take SOURCE_DIR and BACKUP_DIR environment variables or the arguments --source-dir and --backup-dir.--source-dir=<source_dir>: Path to the SQLite database directory.--backup-dir=<backup_dir>: Path to the backup directory.# Create a backup of the source directory
./target/release/sqlite-backup backup --source-dir=/path/to/db --backup-dir=/path/to/backups
# Restore backup files to the source directory
./target/release/sqlite-backup restore --source-dir=/path/to/db --backup-dir=/path/to/backups
# Run the backup service in daemon mode
./target/release/sqlite-backup daemon --source-dir=/path/to/db --backup-dir=/path/to/backups
For issues and feature requests, please open an issue in the GitHub repository.
Content type
Image
Digest
sha256:1e3d9b396…
Size
2.1 MB
Last updated
over 1 year ago
docker pull bpmbee/sqlite-backup