Filesystem Revert - Mass Deletion Recovery and Cleanup

I manage a small network of Windows computers and Syncthing is used between them along with a server that has regular snapshots. There was a unintended mass deletion from a device so I reverted the filesystem to a older snapshot. However now I’m stuck with cleaning up a bunch of empty folders and (possibly) lingering files. So far here’s the timeline of actions.

  • Deletions noticed
  • Shutoff Syncthing on the server
  • zfs rollback xxx/yyy@zzz
  • find /syncthing/path/. -type f -exec touch {} +
  • Start Syncthing on the server
    • I should’ve started Syncthing with the -pause switch here.
  • Pause all folders
  • Set all folders to “Send Only”
  • Resume all folders
  • Wait till clients get the touched “new” files
  • Return folders to “Send & Receive”

Everything’s just about back where it should, but I have a bunch of empty folders (around 500) on the clients that Syncthing refuses to delete. This might’ve been caused by the rollback I did, or was there before this and nobody informed me (I don’t regularly check Syncthing.)

If anyone has any comments on what I did and what I should do in the future that’d be great, but I still have the empty folders issue. I tried setting the clients to Receive only hoping I’d get a “Delete Local Changes” option, but no dice. These are Windows machines and so far I’m guessing I have to whip up a PowerShell script to discard the empty folders and fix any other folders manually, but if there’s some Syncthing feature I’m missing to help me that’d be great to know.

If Syncthing refuses to delete them, they are most likely not empty.

I’d verify that. Windows creates stuff like Thumbs.db etc as hidden files.

If there are genuinely no files there, I’d atleast post the logs of errors (as there should be some), as now there isn’t an awful lot of information to work with.

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