diff --git a/cmd/restic/exclude.go b/cmd/restic/exclude.go index e4a934d9b..9d86f9892 100644 --- a/cmd/restic/exclude.go +++ b/cmd/restic/exclude.go @@ -185,6 +185,11 @@ func isDirExcludedByFile(dir, tagFilename, header string) bool { func gatherDevices(items []string) (deviceMap map[string]uint64, err error) { deviceMap = make(map[string]uint64) for _, item := range items { + item, err = filepath.Abs(filepath.Clean(item)) + if err != nil { + return nil, err + } + fi, err := fs.Lstat(item) if err != nil { return nil, err @@ -215,6 +220,8 @@ func rejectByDevice(samples []string) (RejectFunc, error) { return false } + item = filepath.Clean(item) + id, err := fs.DeviceID(fi) if err != nil { // This should never happen because gatherDevices() would have @@ -222,7 +229,7 @@ func rejectByDevice(samples []string) (RejectFunc, error) { panic(err) } - for dir := item; dir != ""; dir = filepath.Dir(dir) { + for dir := item; dir != filepath.Dir(dir); dir = filepath.Dir(dir) { debug.Log("item %v, test dir %v", item, dir) allowedID, ok := allowed[dir] diff --git a/cmd/restic/excludes b/cmd/restic/excludes deleted file mode 100644 index ab2f4fd31..000000000 --- a/cmd/restic/excludes +++ /dev/null @@ -1,31 +0,0 @@ -/boot -/dev -/etc -/home -/lost+found -/mnt -/proc -/root -/run -/sys -/tmp -/usr -/var -/opt/android-sdk -/opt/bullet -/opt/dex2jar -/opt/jameica -/opt/google -/opt/JDownloader -/opt/JDownloaderScripts -/opt/opencascade -/opt/vagrant -/opt/visual-studio-code -/opt/vtk6 -/bin -/fonts* -/srv/ftp -/srv/http -/sbin -/lib -/lib64