Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore can fail for multiple directories in same snapshot #588

Closed
wscott opened this issue Aug 26, 2016 · 2 comments
Closed

Restore can fail for multiple directories in same snapshot #588

wscott opened this issue Aug 26, 2016 · 2 comments

Comments

@wscott
Copy link

wscott commented Aug 26, 2016

Output of restic version

$ restic version
restic 0.2.0 (v0.2.0-150-g9fd941f)
compiled at 2016-08-25 10:37:59 with go1.6.3

Testcase

Run this script in an empty directory

#!/bin/sh

export RESTIC_REPOSITORY=`pwd`/backups.restic
export RESTIC_PASSWORD=ca19e820beabb3b296ef21b9d6a34778

rm -rf "$RESTIC_REPOSITORY" dir* restore
restic init

mkdir -p dir1/dir3
mkdir -p dir2/dir3
mkdir -p dir2/dir4
echo hi > dir1/dir3/file4
echo bye > dir2/dir3/file5
echo baz > dir2/dir4/file6

restic backup dir1/dir3 dir2/dir3 dir2/dir4

restic snapshots

mkdir restore
restic restore latest -t restore

Output

$ sh -x DOIT.sh 
+ pwd
+ export RESTIC_REPOSITORY=/home/wscott/restic.bug/backups.restic
+ export RESTIC_PASSWORD=ca19e820beabb3b296ef21b9d6a34778
+ rm -rf /home/wscott/restic.bug/backups.restic dir1 dir2 restore
+ restic init
created restic backend 9be29f04e9 at /home/wscott/restic.bug/backups.restic

Please note that knowledge of your password is required to access
the repository. Losing your password means that your data is
irrecoverably lost.
+ mkdir -p dir1/dir3
+ mkdir -p dir2/dir3
+ mkdir -p dir2/dir4
+ echo hi
+ echo bye
+ echo baz
+ restic backup dir1/dir3 dir2/dir3 dir2/dir4
scan [/home/wscott/restic.bug/dir1/dir3 /home/wscott/restic.bug/dir2/dir3 /home/wscott/restic.bug/dir2/dir4]
scanned 3 directories, 3 files in 0:00
[0:00] 100.00%  0B/s  11B / 11B  6 / 6 items  0 errors  ETA 0:00 
duration: 0:00, 0.00MiB/s
snapshot d42c85cb saved
+ restic snapshots
ID        Date                 Host        Directory
----------------------------------------------------------------------
d42c85cb  2016-08-26 15:10:25  x99         /home/wscott/restic.bug/dir1/dir3
                                           /home/wscott/restic.bug/dir2/dir3
                                           /home/wscott/restic.bug/dir2/dir4
+ mkdir restore
+ restic restore latest -t restore
restoring <Snapshot d42c85cb of [/home/wscott/restic.bug/dir1/dir3 /home/wscott/restic.bug/dir2/dir3 /home/wscott/restic.bug/dir2/dir4] at 2016-08-26 15:10:25.29578299 -0400 EDT by wscott@x99> to restore
+ ls -R restore
restore:
dir3  dir4

restore/dir3:
file4

restore/dir4:
file6

Expected result

Restic appears to try and remove extra layers of hierarchy from pathnames, but sometimes this fails.
For example I tried running restic backup /home/wscott /space/wscott but the resulting snapshot only contained 'wscott' that matched /home.

In the above example 'file5' is missing from the restore. It is inconsistent. Sometimes file4 is missing.

@wscott
Copy link
Author

wscott commented Aug 26, 2016

This appears to be a duplicate of #549

@fd0
Copy link
Member

fd0 commented Aug 27, 2016

Indeed, it is a duplicate of #549, I'll close this one and improve the title of the #549.

@fd0 fd0 closed this as completed Aug 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants