jottalib icon indicating copy to clipboard operation
jottalib copied to clipboard

jotta-scanner enters excluded subdirectories

Open awerner opened this issue 8 years ago • 3 comments

$ pip freeze | grep jotta
jottalib==0.5.0
$ cat /etc/debian_version
8.5

I try to do a full backup of one of my vservers with the command: jotta-scanner / /Jotta/Archive/backup/marty --exclude /proc/ --exclude /dev/ --exclude /sys/ --exclude /run/ --exclude /var/run/ --exclude /var/lib/libvirt/images/.

What happens is that jotta enters each and every subdirectory before it gets excluded:

Entering dir: /proc/110/fdinfo
Entering dir: /proc/110/ns
Entering dir: /proc/110/net
Entering dir: /proc/110/net/xt_recent
Entering dir: /proc/110/net/dev_snmp6
Entering dir: /proc/110/net/netfilter
Entering dir: /proc/110/net/stat
Entering dir: /proc/110/attr
Entering dir: /proc/120
Entering dir: /proc/120/task
Entering dir: /proc/120/task/120
Entering dir: /proc/120/task/120/fd
Entering dir: /proc/120/task/120/fdinfo
Entering dir: /proc/120/task/120/ns
Entering dir: /proc/120/task/120/attr
Entering dir: /proc/120/fd
Entering dir: /proc/120/map_files
Entering dir: /proc/120/fdinfo
Entering dir: /proc/120/ns
Entering dir: /proc/120/net
Entering dir: /proc/120/net/xt_recent
Entering dir: /proc/120/net/dev_snmp6
Entering dir: /proc/120/net/netfilter
Entering dir: /proc/120/net/stat

This process is very slow, so the expected behaviour would be to just jump to the next directory.

awerner avatar Aug 18 '16 16:08 awerner

@awerner Hey, thanks for the report.

Well, I agree, that sounds like an area that could use some more smartness. I guess we could even keep a default exclusion list. Who would ever need to backup /proc and /sys, anyway?

I guess this wouldn't be too much work, tweaking the directory traversing code. Do you want to take a look at it yourself?

havardgulldahl avatar Aug 18 '16 18:08 havardgulldahl

Might take a little while as I'm currently moving but yeah, will have a look.

awerner avatar Aug 19 '16 06:08 awerner

@awerner Great!

havardgulldahl avatar Aug 19 '16 21:08 havardgulldahl