How to exclude hidden directories in only the root folder

What is the problem you are having with rclone?

I would like to exclude hidden directories in only the root folder from synchronizing. Hidden directories would be those that start with a dot for example /.atom/. I only want to exclude them from the main root folder, in other locations I want them to be backed up.

For example:

# don't backup
/.atom/
# backup
/myfolder/.anotherdir/

What is your rclone version (output from rclone version)

rclone v1.53.1

  • os/arch: linux/amd64
  • go version: go1.15

Which OS you are using and how many bits (eg Windows 7, 64 bit)

Ubuntu 64bit

Which cloud storage system are you using? (eg Google Drive)

minio

The command you were trying to run (eg rclone copy /tmp remote:tmp)

rclone sync --progress --skip-links --exclude '.*/' /home/carlsonp/ minio-onetb:laptopbackup

So like this?

felix@guardian:~/test$ rclone ls /home/felix/test
1504953150 jellyfish-400-mbps-4k-uhd-hevc-10bit.mkv
        0 backup/blah1
        0 .test/blah
        0 backup/.nope/blah2
felix@guardian:~/test$ rclone ls /home/felix/test --exclude "\.**"
1504953150 jellyfish-400-mbps-4k-uhd-hevc-10bit.mkv
        0 backup/blah1

Close, in your example I want backup/.nope/blah2 to actually be backed up. For example:

$ ls
file1
.nobackup/file2
backup/.another/file3
backup/more/dirs/forever/.last/file4

# expected result:
file1
backup/.another/file3
backup/more/dirs/forever/.last/file4

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.