markdumay/synology-docker

Incorrect message when extracting Docker backup

markdumay opened this issue · 5 comments

When specifying the -b flag to restore from a backup, the working directory is not correctly updated when specifying a fully qualified path. The script tries to extract /volume1/docker/synology-docker//volume1/docker/synology-docker/docker_backup_200611115000.tgz for example, while this should be /volume1/docker/synology-docker/docker_backup_200611115000.tgz.

Sorry, I should have been clearer... it doesn't try and extract the file using that path. I think the only issue here is the text you are outputting for "Step 2 from 5" :)

No worries, I copied the original incorrect output below.

root@DiskStation:/volume1/docker/synology-docker# sudo ./syno_docker_update.sh -b /volume1/docker/synology-docker/docker_backup_200611115000.tgz restore
Update Docker Engine and Docker Compose on Synology to target version

Current DSM version: 6.2.3
Current Docker version: 19.03.11
Current Docker Compose version: 1.26.0
Step 1 from 5: Stopping Docker service
pkgctl-Docker stoped.
Step 2 from 5: Extracting Docker backup (/volume1/docker/synology-docker//volume1/docker/synology-docker/docker_backup_200611115000.tgz)
bin/
bin/containerd
bin/auplink
bin/runc
bin/containerd-shim
bin/ctr
bin/dockerd
bin/docker-init
bin/docker
bin/docker-compose
bin/docker-proxy
dockerd.json
ERROR: Docker compose binary could not be extracted from archive

Nevertheless, it should be step 2 out of 5, no? These are the steps for a restore command:

    restore )
        TOTAL_STEPS=5
        detect_current_versions
        execute_prepare
        define_restore
        execute_stop_syno
        execute_extract_backup
        execute_restore_bin
        execute_restore_log
        execute_start_syno
        ;;

OK, created a new sub branch restore that fixes the message.

Before I read your latest message, I had already looked at the script and found the issue. I've not tested it, but can confirm that the change you made is the same as what I had in mind.

Great, I'll merge this branch with the master and will close this issue.