How to make two independent backups?

I have a local backup, but I still want to make one more backup to the cloud storage , how to do?
I have a cloud storage mounted at the host machine, when I tried to copy the local backup files to the mounted cloud storage, but there was no permisson of the backup files.
so I don’t know how to make two independent backups.

Thank you.

1 Like

From what I understand from your description, this doesn’t seem to be a restic problem but rather one of your local permissions or maybe your permissions on the mounted cloud storage. A restic repository consists of normal files and folders and can indeed easily be copied to an additional location. You can then even use rsync to copy just the changes if the source repository has changed (e.g. rsync -Prvth --delete /source /target).

4 Likes

What I do is run two independent backups.

One backups locally and the other to the cloud. Both are separated by a couple of hours so as not to interfere.

That is, I do not copy the files from the local backup to the cloud. I make another independent backup directly to the cloud.

1 Like

Thank you, I exec rsync -a ,successfully copied the backups from local to cloud, then I deleted the local backups, copied the backups from cloud to local. tested if the backups can be restored again.
docker exec restic restic restore --target /restore 000000
the result is
ignoring error for /mnt: mkdir /restore/mnt: no such file or directory

ignoring error for /mnt: chmod /restore/mnt: no such file or directory
Summary: Restored 0 / 8 files/dirs (0 B / 0 B) in 0:00

can’t be restored this way.

1 Like

How to run two independent backups? I use docker deploy restic.
Thank you :smiley:

1 Like

Sorry I don’t have any experience with using restic within docker but this doesn’t look like a problem with restic but with the setup around it. At least for my limited knowledge there is too little information in your post in order for me to understand what’s going on.

You can see whether a restic repo’s structure is intact by executing restic -r /repo check.

2 Likes

You seem to be overcomplicating things.

The answer to your question “how to run two independent backups?” is simply to run the restic backup command twice - the first time with your first repository, the second time with your second repository. You will then have two separate backups. There’s no need to copy stuff around.

2 Likes

This is my docker compose, how to set a second repository with command twice -

Thank you

version: "3.3"
services:
  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/Udisk/Backup:/mnt/restic    
      - /mnt/sdc1/Udisk/Backup/tmp-for-restore:/tmp-for-restore  
      - /opt/memos:/mnt/volumes/memos:ro  
      - /mnt/sdb1/immich/db_dumps:/mnt/volumes/db_dumps:ro  


  prune:
    image: mazzolino/restic
    container_name: restic-prune
    hostname: docker01
    restart: unless-stopped
    environment:
      SKIP_INIT: "true"
      RUN_ON_STARTUP: "true"
      PRUNE_CRON: "0 0 4 * * *" 
      RESTIC_REPOSITORY: /mnt/restic
      RESTIC_PASSWORD: 


  check:
    image: mazzolino/restic
    container_name: restic-check
    hostname: docker01
    restart: unless-stopped
    environment:
      SKIP_INIT: "true"
      RUN_ON_STARTUP: "false"
      CHECK_CRON: "0 15 5 * * *"  
      RESTIC_CHECK_ARGS: >-
        --read-data-subset=10%
      RESTIC_REPOSITORY: /mnt/restic
      RESTIC_PASSWORD: 
1 Like

If you are/want to use Docker to run your restic backup(s), then you can do one of two things:

  • Run two different restic containers, each having their own configuration and backing up to their own repository (after all, one Docker container is intended to run one process, so there’s nothing wrong or odd with this setup).
  • Run one single restic container, in which you have a script or similar that takes configuration telling it which source directories to back up to which repository. In this case it might be useful to use something like resticprofile to do the backups based on a proper configuration file that you give it/the container.
1 Like

Thank you, I still have a question, I have two BACKUP SOURCES, I need backup one of them daily, backup the other weekly, how to set.

:joy:

1 Like

Same as above, if you want to run it using Docker containers - run several containers with each their own configuration, or one container with a configuration that defines which sources you want backed up when/how/to where.

1 Like

The restore problem has solved by changing the restore location, it was a folder permission problem resulted [the ignoring error no such file or directory]

4 Likes

Full agree! You also avoid possible problems with backup copies.