date/age ignore pattern


(Mark Tomlinson) #1

Hi Syncthing gurus! Thanks for making such a great product!

As a power user who frequently uses an /Archive* subfolder in my ignore patterns to store older files/folder that I wish not to sync to the clients any longer.

Would it be possible to have a date-based ignore pattern? This could be defined similar to a -mtime or -atime or -ctime in a unix find command. It could be a tag on a specific sub-folder/path.

A global filter for all members in the folder:

* -mtime +30d

For a specific sub-folder:

Videos/* -ctime +1h

Forgive me if has already been posted/shared.

Cheers,

-mt


(Jakob Borg) #2

What is the purpose of the ignore pattern? Assuming we implemented what you suggest, and things became ignored after a certain amount of time, nothing would change. The files have already been synced, ignoring them at this point has no effect. Any change to them, which could potentially be ignored, would update the mtime and thus unignore them again.


(Mark Tomlinson) #3

The purpose generally would be operate like a cache where “files you are actively using, recently created or frequently changing” would be sync’d to the client. And, thus, older files you don’t really use/touch much could be left out of the synchronization. This would help manage space on the client side - where you only need recent files.

My current workaround: set an “Archive/*” ignore pattern…and then I manually copy old files/folders into that sub-folder when I don’t want to sync them to the clients.

Other ideas I can imagine a few things:

  • on a new shared folder, only files that have been “recently updated” per the time specification. Like, only sync files/folders modified in the last N days.

  • on an existing shared folder, files that are beyond the time specification would be removed from the remote client and not synchronized in the future


(Audrius Butkevicius) #4

No other file sync tool does that, so even tho it sounds cool, I feel this is opening a can of worms where we will soon have rules that sync files based on the moon phase.


(Jakob Borg) #5

Thing is, what files should be removed on the remote client looks more like a remote client decision from where I’m looking. The typical “sync my pictures from my phone to the server, let me remove pictures on my phone” flow, which is similar, is something like

  • Set up the source and destination devices as usual
  • Set the “ignore deletes” option on the destination

New files from the source get synced to the destination. Files deleted on the source remain on the destination.

In your case you may want to set the “ignore deletes” option on the other side, and have a periodic script to remove old files on the destination, or something like that.


(Kluppy) #6

If you ignore it based on its age it wouldn’t be removed from the remote client. It would stay on the remote clients and the original node would ignore changes made to the file by any other clients.

Also, IMHO, the number of forum requests from someone who can’t get a file to sync because they moved it from somewhere and the mtime is within the ignore window would be crazy.