docker-borgbackup icon indicating copy to clipboard operation
docker-borgbackup copied to clipboard

PATH arguments listed twice when backup is created

Open jpellenz opened this issue 7 years ago • 1 comments

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.

jpellenz avatar Mar 16 '18 22:03 jpellenz

Seems to be a side effect from commit c2f53a342f0379e7175664334a4291d70491ac8d where the second call to help_init_from_ini() was introduced.

jpellenz avatar Mar 16 '18 22:03 jpellenz