What is the problem you are having with rclone?
lsf
(and probably other listing commands) are outputting all subdirs, even excluded ones. See the command section for more details and tests.
I suspect it is related to allowing them to pass for the sake of walking the tree but they should be filtered out of the final display!
Discourse suggests this post but that seems to be an issue with the filtering syntax. This is pretty simple filters.
What is your rclone version (output from rclone version
)
rclone v1.57.0
- os/version: darwin 10.15.7 (64 bit)
- os/kernel: 19.6.0 (x86_64)
- os/type: darwin
- os/arch: amd64
- go/version: go1.17.2
- go/linking: dynamic
- go/tags: cmount
Which cloud storage system are you using? (eg Google Drive)
Local to test and demo. Seen on OneDrive and SFTP
The command you were trying to run (eg rclone copy /tmp remote:tmp
)
Consider the following files: (as per rclone tree .
)
/
├── file1.keep
├── subdirA
│ └── file2.exc
├── subdirB
│ ├── file3.exc
│ └── file4.keep
├── subdirC.keep
│ └── file5.exc
├── subdirD.keep
│ └── file6.keep
├── subdirE.exc
│ └── file7.exc
└── subdirF.exc
└── file8.keep
And the following outputs: (the |sort
is just to ensure the display is the same)
--include
Based
$ rclone lsf -R . --include "*.keep"|sort
file1.keep
subdirA/
subdirB/
subdirB/file4.keep
subdirC.keep/
subdirD.keep/
subdirD.keep/file6.keep
subdirE.exc/
subdirF.exc/
subdirF.exc/file8.keep
Equivalent --filter
based:
$ rclone lsf -R . --filter "+ *.keep" --filter "- **"|sort
file1.keep
subdirA/
subdirB/
subdirB/file4.keep
subdirC.keep/
subdirD.keep/
subdirD.keep/file6.keep
subdirE.exc/
subdirF.exc/
subdirF.exc/file8.keep
An additional explicit exclude
$ rclone lsf -R . --filter "+ *.keep" --filter "- **" --filter "- *.exc" |sort
file1.keep
subdirA/
subdirB/
subdirB/file4.keep
subdirC.keep/
subdirD.keep/
subdirD.keep/file6.keep
subdirE.exc/
subdirF.exc/
subdirF.exc/file8.keep
And just for good measure, Be even more explicit
$ rclone lsf -R . --filter "+ *.keep" --filter "- **" --filter "- *.exc" --filter "- *.exc/**" |sort
file1.keep
subdirA/
subdirB/
subdirB/file4.keep
subdirC.keep/
subdirD.keep/
subdirD.keep/file6.keep
subdirE.exc/
subdirF.exc/
subdirF.exc/file8.keep
Obviously, I could just use --files-only
but that is (a) a workaround to the actual problem and (b) still shows (implicitly and explicityly) excluded directory listings.
The rclone config contents with secrets removed.
N/A (local)
A log from the command with the -vv
flag
Just from the initial
2021/12/30 08:00:23 DEBUG : rclone: Version "v1.57.0" starting with parameters ["rclone" "lsf" "-R" "." "--include" "*.keep" "-vv"]
2021/12/30 08:00:23 DEBUG : Creating backend with remote "."
2021/12/30 08:00:23 DEBUG : Using config file from "/Users/<REDACTED>/.config/rclone/rclone.conf"
2021/12/30 08:00:23 DEBUG : fs cache: renaming cache item "." to be canonical "/Users/<REDACTED>/test"