diff --git a/.gitignore b/.gitignore index 20e36df..f436d28 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .env swag filebrowser-docker +autorestic/config/.autorestic.lock.yml diff --git a/autorestic/config/.autorestic.yml b/autorestic/config/.autorestic.yml new file mode 100644 index 0000000..9d0f7ef --- /dev/null +++ b/autorestic/config/.autorestic.yml @@ -0,0 +1,26 @@ +version: 2 + +locations: + home: + from: + - /data/installers + # Or multiple + # from: + # - /foo + # - /bar + to: + - hdd + +backends: + # remote: + # type: s3 + # path: 's3.amazonaws.com/bucket_name' + # key: some-random-password-198rc79r8y1029c8yfewj8f1u0ef87yh198uoieufy + # env: + # AWS_ACCESS_KEY_ID: account_id + # AWS_SECRET_ACCESS_KEY: account_key + + hdd: + type: local + path: /repo/autorestic_repo + key: 'if not key is set it will be generated for you' diff --git a/autorestic/docker-compose.yml b/autorestic/docker-compose.yml new file mode 100644 index 0000000..c12a364 --- /dev/null +++ b/autorestic/docker-compose.yml @@ -0,0 +1,26 @@ +services: + autorestic: + image: cupcakearmy/autorestic + container_name: autorestic + hostname: autorestic-backup + # We mount the autorestic config file into the container. + # We mount the data you want to back up (E:\installers) into the container at /data/installers. + # We mount the repository location (G:\autorestic-backups) into the container at /repo/autorestic_repo. + # We use a named volume for the restic cache for persistence and performance. + volumes: + - ./config:/config + - e:/installers:/data/installers:ro + - g:/autorestic-backups:/repo/autorestic_repo + - autorestic_cache:/root/.cache/restic + # Pass secrets as environment variables. + environment: + - RESTIC_PASSWORD=YOUR_STRONG_REPOSITORY_PASSWORD + # This command will automatically run backups, checks, and prunes + # based on the cron schedules defined in your .autorestic.yml + command: > + /bin/sh -c "while true; do autorestic --config /config/.autorestic.yml cron; sleep 3600; done" + restart: unless-stopped + +# Define the named volume for the cache +volumes: + autorestic_cache: