djmaze / resticker

Run automatic restic backups via a Docker container.
https://hub.docker.com/r/mazzolino/restic/
Apache License 2.0
498 stars 67 forks source link

different source with different backup schedule? #214

Open Yumega opened 2 weeks ago

Yumega commented 2 weeks ago

Daear djmaze, I have two sources, is it possible to backup source A daily and backup source B weekly? if it's possible, how to change the following compose? Thank you.

backup:
    image: mazzolino/restic
    container_name: restic
    hostname: docker01
    restart: unless-stopped
    environment:
      RUN_ON_STARTUP: "true"
      BACKUP_CRON: "0 30 3 * * *"  
      RESTIC_REPOSITORY: /mnt/restic
      RESTIC_PASSWORD: 
      RESTIC_BACKUP_SOURCES: /mnt/volumes
      RESTIC_COMPRESSION: auto
      RESTIC_BACKUP_ARGS: >-
        --tag memos
        --tag immich/db_dumps
        --verbose
      RESTIC_FORGET_ARGS: >-
        --keep-last 10
        --keep-daily 7
        --keep-weekly 5
        --keep-monthly 12
    volumes:
      - /mnt/sdc1/Backup:/mnt/restic    
      - /mnt/sdc1/Backup/tmp-for-restore:/tmp-for-restore  #restore path
      - /opt/memos:/mnt/volumes/memos:ro  #source A
      - /mnt/sdb1/immich/db_dumps:/mnt/volumes/db_dumps:ro  #source B
5a5cha commented 2 weeks ago

Hi Yumega,

one Cron for one container. Your idea can't be done with one container and a "split" in the Cron config.

Why not using two different containers with two different restic repos? /mnt/sdc1/Backup/ThingsFromSourceA /mnt/sdc1/Backup/ThingsFromSourceB

Yumega commented 2 weeks ago

Hi Yumega,

one Cron for one container. Your idea can't be done with one container and a "split" in the Cron config.

Why not using two different containers with two different restic repos? /mnt/sdc1/Backup/ThingsFromSourceA /mnt/sdc1/Backup/ThingsFromSourceB

Thank you, very helpful👍👍