Monday, May 20, 2024
4
rated 0 times [  4] [ 0]  / answers: 1 / hits: 2606  / 3 Years ago, wed, may 12, 2021, 2:28:09

Here is grive's man page section for ignore.



--ignore <perl_regexp>
Ignore files with relative paths matching this Perl Regular
Expression. Value is remembered for next runs.


I do not know how to use perl regular expressions, but would like to be able to ignore multiple directories like so grive --ignore ./irrelevant/file.txt && ./unnecesary/file.txt


More From » command-line

 Answers
3

Ignoring multiple directories can be done by using positive lookahead.
This regex ignores the directories "irrelevant" and "unnecessary":



grive --ignore '(?=^irrelevant$)|(?=^unnecessary$)'


The dry-run command I used for testing:



grive --dry-run --verbose --ignore '(?=^irrelevant$)|(?=^unnecessary$)' > output.txt 2>&1


The directories 'irrelevant' and 'unnecessary' were ignored while the file 'irrelevant1' was not. Hope this works for you.



Update (as of 2017-04-01): latest version of grive2 introduced .griveignore which is syntactically close to .gitignore.


[#14017] Thursday, May 13, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
turhizz

Total Points: 82
Total Questions: 106
Total Answers: 96

Location: South Korea
Member since Mon, Dec 6, 2021
3 Years ago
;