What is the problem you are having with rclone?
I want to exclude all files in a directory, but include all sub-directories and sub-directory files. Let me present an example.
I have a directory named
dir with two files (
file2), and one subdirectory named
subdir directory contains one file named
I want to exclude all files in the
dir directory (
file2, etc.), while including all sub-directories, and all files in the sub-directories of
Run the command 'rclone version' and share the full output of the command.
- os/arch: linux/amd64
- go version: go1.13.8
Which cloud storage system are you using? (eg Google Drive)
The command you were trying to run (eg
rclone copy /tmp remote:tmp)
rclone sync -n ~/path/to/dir/ gdrive:backup --exclude "dir/**"
This command excludes everything. How do I exclude only the files in the directory, but keep sub-directories, and sub-directory files?
Note that this excludes all files in dirctories called
dir, if you want a specific directory called dir in the root then use
If you only want to exclude files in the directory and not subdirectories then
--exclude /dir/* should do it.
You can test with
rclone lsf -R gdrive:backup --exclude "/dir/*" or with
rclone sync -n like you have been doing.
I did this as the exclude only didn't work:
felix@gemini:~/test$ rclone ls /home/felix/test
felix@gemini:~/test$ rclone ls /home/felix/test --filter '+ subdir/**' --filter '- **'
felix@gemini:~/test$ rclone ls /home/felix/test --exclude '/dir/*'
I was able to get both solutions to work, I just had to go up one directory higher and run things from the
home directory, instead of the
felix@gemini:~$ rclone ls /home/felix/test
felix@gemini:~$ rclone ls /home/felix/test --filter '+ subdir/**' --filter '- **'
felix@gemini:~$ rclone ls /home/felix/test --exclude '/dir/*'
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.