elesiuta / backupy

A simple backup program in python with an emphasis on data integrity and transparent behaviour
https://pypi.org/project/BackuPy/
GNU General Public License v3.0
51 stars 3 forks source link

Support of regex #9

Open eharvey71 opened 1 year ago

eharvey71 commented 1 year ago

Regex doesn't seem to work with all regex pattern matching operators. I want to exclude directories that contain python virtual environments which have a variety of names. something like /_env/ works but not the /[^.]_env/ below... I want to match on all characters except for a dot (.) in directory names: https://regex101.com/r/kpYkVr/1

backupy ~/dev /Volumes/exFAT-1TB/backups/dev --fe /node_modules/ /[^.]_env/ /amplify/

Any help is appreciated. Thanks!

elesiuta commented 1 year ago

Backupy doesn't use / as a delimiter for its regexes like most other tools such as sed or awk, so here they are matching the / in the paths. You can omit them or use quotes instead, so either:

backupy ~/dev /Volumes/exFAT-1TB/backups/dev --fe node_modules [^.]_env amplify or backupy ~/dev /Volumes/exFAT-1TB/backups/dev --fe "node_modules" "[^.]_env" "amplify"

should work.

Hope that helps!