Compare commits
No commits in common. "2c6dfbdb0952bfb7afa4db3e086abb2a2100f2af" and "ad0f20f17a116233e3b384884b2ea5488bfed76e" have entirely different histories.
2c6dfbdb09
...
ad0f20f17a
10 changed files with 11 additions and 222 deletions
5
.gitignore
vendored
5
.gitignore
vendored
|
|
@ -1,8 +1,3 @@
|
|||
.env
|
||||
swag
|
||||
filebrowser-docker
|
||||
autorestic/config/.autorestic.lock.yml
|
||||
.nextcloudsync.log
|
||||
.sync_cd2c53ad47df.db
|
||||
.sync_cd2c53ad47df.db-shm
|
||||
.sync_cd2c53ad47df.db-wal
|
||||
|
|
|
|||
|
|
@ -1,2 +0,0 @@
|
|||
[.ShellClassInfo]
|
||||
IconResource=C:\Program Files\Nextcloud\nextcloud.exe,1
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
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'
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
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:
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
# This is actually added as a hook to backrest
|
||||
|
||||
docker exec -t immich_postgres pg_dumpall -c -U $DB_USERNAME > /tmp/immich-dump.sql
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
:: Backup Immich Photos to Islensku
|
||||
D:\restic\restic_0.18.1_windows_amd64.exe ^
|
||||
--password-file=D:\restic\pwd_restic_repo.txt ^
|
||||
-r rest:https://backup138.dawsonst.ca/immich-photos-d ^
|
||||
backup ^
|
||||
D:\immich-photos
|
||||
|
||||
:: Backup Immich Photos to Boss
|
||||
D:\restic\restic_0.18.1_windows_amd64.exe ^
|
||||
--password-file=D:\restic\pwd_restic_repo.txt ^
|
||||
-r rest:http://192.168.68.53:7378/immich-photos ^
|
||||
backup ^
|
||||
D:\immich-photos
|
||||
|
||||
pause
|
||||
|
|
@ -25,13 +25,13 @@ services:
|
|||
ports:
|
||||
- '2283:2283'
|
||||
networks:
|
||||
- immich-net
|
||||
- caddy-network
|
||||
depends_on:
|
||||
- redis
|
||||
- database
|
||||
restart: always
|
||||
healthcheck:
|
||||
disable: true
|
||||
disable: false
|
||||
|
||||
immich-machine-learning:
|
||||
container_name: immich_machine_learning
|
||||
|
|
@ -46,7 +46,7 @@ services:
|
|||
env_file:
|
||||
- .env
|
||||
networks:
|
||||
- immich-net
|
||||
- caddy-network
|
||||
restart: always
|
||||
healthcheck:
|
||||
disable: false
|
||||
|
|
@ -57,12 +57,12 @@ services:
|
|||
healthcheck:
|
||||
test: redis-cli ping || exit 1
|
||||
networks:
|
||||
- immich-net
|
||||
- caddy-network
|
||||
restart: always
|
||||
|
||||
database:
|
||||
container_name: immich_postgres
|
||||
image: ghcr.io/immich-app/postgres:14-vectorchord0.4.3-pgvectors0.2.0
|
||||
image: ghcr.io/immich-app/postgres:14-vectorchord0.4.1-pgvectors0.2.0
|
||||
environment:
|
||||
POSTGRES_PASSWORD: ${DB_PASSWORD}
|
||||
POSTGRES_USER: ${DB_USERNAME}
|
||||
|
|
@ -73,14 +73,14 @@ services:
|
|||
volumes:
|
||||
# Do not edit the next line. If you want to change the database storage location on your system, edit the value of DB_DATA_LOCATION in the .env file
|
||||
- ${DB_DATA_LOCATION}:/var/lib/postgresql/data
|
||||
shm_size: 1gb
|
||||
networks:
|
||||
- immich-net
|
||||
- caddy-network
|
||||
restart: always
|
||||
|
||||
networks:
|
||||
immich-net:
|
||||
caddy-network:
|
||||
external: true
|
||||
# driver: bridge
|
||||
|
||||
volumes:
|
||||
model-cache:
|
||||
|
|
|
|||
|
|
@ -1,78 +0,0 @@
|
|||
# Run once: docker compose -f docker-compose-init.yml up --build --force-recreate
|
||||
|
||||
services:
|
||||
kopia_init:
|
||||
image: kopia/kopia:latest
|
||||
container_name: kopia_init
|
||||
# Use the passwords from .env
|
||||
environment:
|
||||
- KOPIA_REPOSITORY_PASSWORD=${KOPIA_REPOSITORY_PASSWORD}
|
||||
- PUID=1000
|
||||
- PGID=1000
|
||||
|
||||
# Volumes MUST match the server setup so the repository is initialized in the correct place.
|
||||
volumes:
|
||||
- kopia_config:/app/config
|
||||
- kopia_cache:/app/cache
|
||||
- kopia_logs:/app/logs
|
||||
- g:/kopia-backups:/app/repository # CRITICAL: This is where the repo will be created
|
||||
|
||||
# --- YOUR SOURCE DATA ---
|
||||
# Maps your host's E:\installers and H:\immich-photos to specific paths inside the container.
|
||||
# ':ro' (read-only) is a safety best practice.
|
||||
- e:/installers:/source/installers:ro
|
||||
- h:/immich-photos:/source/immich-photos:ro
|
||||
|
||||
# Override the default Kopia ENTRYPOINT to use the standard shell.
|
||||
entrypoint: /bin/sh
|
||||
|
||||
# This command now runs 4 steps sequentially:
|
||||
# 1. Create the repository.
|
||||
# 2. Connect to it (so subsequent commands work).
|
||||
# 3. SET POLICY for /source/installers (12h interval + retention).
|
||||
# 4. SET POLICY for /source/immich-photos (12h interval + retention).
|
||||
command:
|
||||
- -c
|
||||
- |
|
||||
# 1. Create the Kopia Repository
|
||||
echo 'Creating new Kopia repository at /app/repository...'
|
||||
kopia repository create filesystem \
|
||||
--path=/app/repository \
|
||||
--password=${KOPIA_REPOSITORY_PASSWORD} \
|
||||
&& \
|
||||
# 2. Explicitly connect to the repository non-interactively.
|
||||
# This is CRITICAL for the policy commands to work.
|
||||
echo 'Connecting to repository non-interactively...' && \
|
||||
kopia repository connect filesystem \
|
||||
--path=/app/repository \
|
||||
--password=${KOPIA_REPOSITORY_PASSWORD} \
|
||||
&& \
|
||||
# 3. SET POLICY for installers (Schedule: 12h)
|
||||
# This does NOT run a snapshot. It just saves the schedule.
|
||||
echo 'Setting 12-hour schedule for /source/installers...' && \
|
||||
kopia policy set /source/installers \
|
||||
--snapshot-interval 12h \
|
||||
--keep-daily 7 \
|
||||
--keep-weekly 4 \
|
||||
--keep-monthly 12 \
|
||||
--password=${KOPIA_REPOSITORY_PASSWORD} \
|
||||
&& \
|
||||
# 4. SET POLICY for immich-photos (Schedule: 12h)
|
||||
echo 'Setting 12-hour schedule for /source/immich-photos...' && \
|
||||
kopia policy set /source/immich-photos \
|
||||
--snapshot-interval 12h \
|
||||
--keep-daily 7 \
|
||||
--keep-weekly 4 \
|
||||
--keep-monthly 12 \
|
||||
--password=${KOPIA_REPOSITORY_PASSWORD}
|
||||
|
||||
echo 'Initialization complete. Repository created and policies set.'
|
||||
|
||||
# Do not restart since it's a one-off command
|
||||
restart: "no"
|
||||
|
||||
# Re-using the same Docker-managed volumes
|
||||
volumes:
|
||||
kopia_config:
|
||||
kopia_cache:
|
||||
kopia_logs:
|
||||
|
|
@ -24,15 +24,14 @@ services:
|
|||
- kopia_logs:/app/logs
|
||||
|
||||
# --- YOUR BACKUP DESTINATION ---
|
||||
# Maps your host's G:\kopia-backups to /app/repository inside the container.
|
||||
# Maps your host's F:\test_backup to /app/repository inside the container.
|
||||
# Kopia will write its backup data here.
|
||||
- g:/kopia-backups:/app/repository
|
||||
- f:/test_backup:/app/repository
|
||||
|
||||
# --- YOUR SOURCE DATA ---
|
||||
# Maps your host's E:\installers and H:\immich-photos to /source/installers inside the container.
|
||||
# Maps your host's E:\installers to /source/installers inside the container.
|
||||
# ':ro' (read-only) is a safety best practice.
|
||||
- e:/installers:/source/installers:ro
|
||||
- h:/immich-photos:/source/immich-photos:ro
|
||||
|
||||
command:
|
||||
- server
|
||||
|
|
@ -40,7 +39,6 @@ services:
|
|||
- --ui
|
||||
- --address=0.0.0.0:51515
|
||||
- --insecure
|
||||
- --password=${KOPIA_REPOSITORY_PASSWORD}
|
||||
- --server-username=${KOPIA_SERVER_USERNAME}
|
||||
- --server-password=${KOPIA_SERVER_PASSWORD}
|
||||
restart: unless-stopped
|
||||
|
|
|
|||
|
|
@ -1,54 +0,0 @@
|
|||
# init REPOSITORY 1 with
|
||||
# docker run --rm -e RESTIC_PASSWORD=yourpassword -v G:/restic-backups:/backup restic/restic init --repo /backup
|
||||
|
||||
services:
|
||||
restic-backup:
|
||||
image: restic/restic:latest
|
||||
container_name: restic-backup
|
||||
environment:
|
||||
# --- REPOSITORY 1: REMOTE REST SERVER ---
|
||||
- RESTIC_REPOSITORY_REMOTE=${RESTIC_REPOSITORY_REMOTE}
|
||||
- RESTIC_PASSWORD_REMOTE=${RESTIC_PASSWORD_REMOTE}
|
||||
|
||||
# --- REPOSITORY 2: LOCAL FOLDER ---
|
||||
- RESTIC_REPOSITORY_LOCAL=${RESTIC_REPOSITORY_LOCAL}
|
||||
- RESTIC_PASSWORD_LOCAL=${RESTIC_PASSWORD_LOCAL}
|
||||
|
||||
volumes:
|
||||
# Data to backup (Read-Only)
|
||||
- F:/roms/megadrive:/data/roms:ro
|
||||
- H:/immich-photos:/data/immich-photos:ro
|
||||
|
||||
# REPOSITORY 1: Local Backup Folder
|
||||
- G:/restic-backups:/backup
|
||||
|
||||
entrypoint: >
|
||||
sh -c "while true; do \
|
||||
\
|
||||
echo '--- Starting Remote Backup ---' && \
|
||||
export RESTIC_REPOSITORY=$RESTIC_REPOSITORY_REMOTE && \
|
||||
export RESTIC_PASSWORD=$RESTIC_PASSWORD_REMOTE && \
|
||||
restic backup /data/roms && \
|
||||
\
|
||||
echo '--- Starting Remote Prune ---' && \
|
||||
restic forget --prune --keep-daily 7 --keep-weekly 4 --keep-monthly 12 --keep-yearly 0; \
|
||||
\
|
||||
echo '--- Starting Local Backup ---' && \
|
||||
export RESTIC_REPOSITORY=$RESTIC_REPOSITORY_LOCAL && \
|
||||
export RESTIC_PASSWORD=$RESTIC_PASSWORD_LOCAL && \
|
||||
restic backup /data/roms && \
|
||||
\
|
||||
echo '--- Starting Local Prune ---' && \
|
||||
restic forget --prune --keep-daily 7 --keep-weekly 4 --keep-monthly 12 --keep-yearly 0; \
|
||||
\
|
||||
echo '--- Cleanup and Sleep ---' && \
|
||||
unset RESTIC_REPOSITORY && \
|
||||
unset RESTIC_PASSWORD && \
|
||||
echo '--- Backup Cycle Complete. Sleeping... ---' && \
|
||||
sleep 43200; \
|
||||
done"
|
||||
|
||||
restart: unless-stopped
|
||||
|
||||
# restic backup /data/roms /data/immich-photos &&
|
||||
# restic backup /data/roms /data/immich-photos &&
|
||||
Loading…
Add table
Add a link
Reference in a new issue