adding the ignore condition, only files can be deleted, but folders cannot be deleted?

  • . stignore
!D/**/Info/ExperimentInfo.txt
*
  • macos
(base) ╭─facebook at FaceBook的MacBook Pro in ~/Sync using 
╰─○ ls
D                  ExperimentInfo.txt
(base) ╭─facebook at FaceBook的MacBook Pro in ~/Sync using 
╰─○ rm -rf D 
  • other
[edge@gs-server-11051 kmci3-tuqhj]$ tree
.
└── D
    └── csv222
        └── Info

Only deleted the Experiment Info.txt file, the D folder was not deleted …

Please be more specific and describe in details what you actually desire to do. It may be just me, but all the funky characters don’t really help either :wink:.

Screenshots may better display what you’re trying to do, so if you can, please show how the situation looks in the Syncthing Web GUI, including the ignore patterns.

  • macos

  • edge

want:

I hope that when the D folder is deleted on macOS, edge can also delete the D folder. Now just delete the file, not delete the folder

Only the file is “not ignored”, all the folders under it are technically ignored, hence are not touched, even if not needed.

Very ugly, but this should do the job. Tested locally, and the whole tree does get deleted this way.

!D/**/Info/ExperimentInfo.txt
(?d)D/**/
!D/**
(?d)D/
!D
(?d)*

Thank you so much for your help, you really helped me out with a big problem

1 Like

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