jotta / jotta-cli-issues

45 stars 1 forks source link

Adding a trailing slash to ignore pattern makes it impossible to remove it (ignore v2) #181

Closed haakemon closed 2 years ago

haakemon commented 2 years ago

Make sure you are running the latest version of jotta-cli before reporting an issue.

jotta-cli release (jotta-cli version): jottad version : 0.14.60923 jotta-cli version : 0.14.60923

Description of problem: I've managed to add 2 entries to my ignores list, that only differ with a trailing slash. According to the docs, trailing slashed are ignored, so I figured it would be best to not have traling slashes at all - but now it seems to be impossible to remove the entry with the trailing slash.

When trying to remove the pattern, it seems like it also works, since it starts to upload files from the ignored directory. But both ignore entries are still present as well.

I've tried removing the one without the slash, and it gets removed. The trailing slash entry still remains, and is still not possible to remove it even if its the only entry.

List of patterns:

jotta-cli ignores list
Listing patterns for backup: /backup/homeassistant
 > "**/storage/cache/"
 > "**/storage/cache"

Trying to remove the pattern with trailing slash:

jotta-cli ignores rem --pattern "**/storage/cache/"
Listing patterns for backup: /backup/homeassistant
 > "**/storage/cache/"
 > "**/storage/cache"

As you can see, the entry with trailing slash is still present.

Expected: When trying to remove a pattern with a trailing slash, it should be removed.

jotta-cli ignores rem --pattern "**/storage/cache/"
Listing patterns for backup: /backup/homeassistant
 > "**/storage/cache"

jotta-cli status (jotta-cli status):

Relevant logs for the issue (~/.jottad/jottabackup.log or /var/lib/jotta/jottabackup.log )

Traceback

Additional info:

haakemon commented 2 years ago

I found the issue just after I posted this.

The issue I had, was that I initially managed to add the entries with quotes, so when trying to remove the patterns it wouldnt match. Executing jotta-cli ignores rem --pattern "\"**/storage/cache/"\" worked.