Skip to content

PATH arguments listed twice when backup is created #12

@jpellenz

Description

@jpellenz

Steps to reproduce:

  1. Create a borgbackup.ini file with PATH entries:
    ...
    PATH = /tmp/project
    PATH = /tmp/project2
    ...

  2. Create a backup

  • ./borgctl backup ./borgbackup.ini
  1. Expected behavior
  • elements in path are listed once
  1. Actual behavior
  • elements in path are listed twice:
    -+> BACKUP for 001 ...
    -+> borg create -s -v --list -C zlib,6 ::tftp-201803162311170100 /BACKUP//tmp/project /BACKUP//tmp/project2 /BACKUP//tmp/project /BACKUP//tmp/project2
    U /BACKUP/tmp/project/test1.txt
    U /BACKUP/tmp/project/test2.txt
    d /BACKUP/tmp/project
    A /BACKUP/tmp/project2/test1.txt
    A /BACKUP/tmp/project2/test2.txt
    d /BACKUP/tmp/project2
    U /BACKUP/tmp/project/test1.txt
    U /BACKUP/tmp/project/test2.txt
    d /BACKUP/tmp/project
    U /BACKUP/tmp/project2/test1.txt
  1. Probably the problem is in the BACKUPS[PATH${id}] contruction in help_init_from_ini():

In help_init_from_ini():

 ...
                            if [[ "$2" == "PATH" ]]; then
                                    BACKUPS[PATH${id}]="${BACKUPS[PATH${id}]} ${3}"
                            fi
 ...

Since help_init_from_ini() is called multiple times (from docker_compare_host_container_script() and docker_set_borg_repo()), the BACKUPS[PATH${id}] is extended twice by the PATH arguments.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions