jotta / jotta-cli-issues

45 stars 1 forks source link

ignores v2 not working #161

Open MyUncleSam opened 2 years ago

MyUncleSam commented 2 years ago

jotta-cli release (jotta-cli version): 0.12.50392

Description of problem: I try to add ignores for folders using ignores v2 but it is not working.

Example: Backup-folder: /backup/docker Exclude-path: /backup/docker/_container (folder)

tried:

jotta-cli ignores add -p _container/
jotta-cli ignores add -p /_container/
jotta-cli ignores add -p /backup/docker/_container/
jotta-cli ignores add -p /backup/docker/_container

Expected: Not scanning and backing up /backup/docker/_container (folder) - removing backed up files from jotta-backup.

jotta-cli status (jotta-cli status):

------------------------------------------------------------------------------
 Account   : XXXXXXX on 
 Usage     : 2.62TiB / ( Unlimited )
 Device    : XXXXXXX
------------------------------------------------------------------------------
 Backups   :
------------------------------------------------------------------------------
   Path      : /backup/docker
   Scanning  : /_container/container-station-data/lib/docker/overlay2/742a7a5602defec3e0460d9f4cdb7432229289c6183e661138b64633946ae4fd/merged/sys/block/loop11/queue 
   Files     : 344944 (88.39GiB)
   Status    : Transferring - 46137 files (704.30MiB) remaining 

------------------------------------------------------------------------------
OK

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

---

Traceback

---

Additional info:

Maybe I am using it wrong - but there is no documentation how to use it, the only one is https://docs.jottacloud.com/en/articles/1437235-ignoring-files-and-folders-from-backup-with-jottacloud-cli which seems to be outdated/for version 1.

Kimbsen commented 2 years ago

Drop the trailing / at the end.

$ ./jotta-cli ignores test --pattern _container/ --path _container
Pattern [_container/] did not match path[/_container]

$ ./jotta-cli ignores test --pattern _container --path _container
Pattern [_container] matched path[/_container]

We'll get the docs updated tomorrow.

coopersimon commented 2 years ago

The next release will have a way of auto-patching from the old exclude system to the new one.

bluet commented 2 years ago

@coopersimon After upgrading jotta-cli version, the current .ignore file stopped working (jotta uploaded everything). In jotta-cli ignores --help, I saw the command jotta-cli ignores use-version-2 and did it, and it fixed nothing. After some checking, I saw the command jotta-cli ignores patch and did it, but it says:

root@jottacloud:/src# jotta-cli ignores patch                        
ERROR  error patching ignores:
[patch /backup/homes ignores: ([) not supported by patterns v2]

Now I'm stuck. What and how should I do to make my lengthy .ignore file work again? Using commands to add/remove ignores rules (and as The Only Way) is not a good idea. We need to EDIT the rules in our favorite editors (ex, vscode).

coopersimon commented 2 years ago

Hi bluet, right now we don't support [] in the new ignores system.

I'd love your feedback though:

For now, if you can find a workaround for having no [], you could remove it from your ignores file and try patching again.