date/age ignore pattern

(mytamhuyet) #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,

0 Likes

(Jakob Borg) #2

I don’t see any technical blocker to prevent such a thing, but I think it might be confusing in practice.

Let’s say we have the -mtime +30d ignore filter on a new folder we just added. It’s straightforward what happens: files not modified in the last 30 days are ignored and not scanned, not sent to other devices, etc. A file that is 29 days old will be scanned and sent as normal.

Next day that file is now too old and gets ignored. This doesn’t have any effect as all clients are already up to date and have synced it.

If that file changes at any point (including being deleted) it will get a new mtime and no longer match the ignore pattern, so it will be scanned and sent anyway. The effect of the whole thing is roughly null.

I guess it’s more useful in the other direction (incoming updates) as we can then skip pulling down old files…

0 Likes

(David R) #3

While I’ve put in this request elsewhere, and hence won’t elaborate too much on it, an approach for automatically limiting the amount of data that is synced to a client device that is starting to become more widely implemented is the concept of a cached virtual filesystem, which, rather than discerning specifically by dates, keeps the most recently accessed files synced on the client, up to an amount of disk space determined by the user, while keeping other files listable. I would admit, though, that which approach gives you a better hit ratio might be dependent on usage patterns.

0 Likes

(David R) #4

What about a modification of the OP’s idea that would borrow from both concepts. The idea would be that the date-based ignore (or include) pattern would download and sync files less than a certain age, as suggested, but it would be “sticky” in that files older than that age would not become excluded and un-synced unless the total disk usage of all synced files went above a user-defined threshold? This would avoid things like everything becoming excluded if there are no new files added within 30 days (to go with the example above). It might be a way of achieving some of the advantages of a cached virtual filesystem by making a small change to the include/exclude feature.

The main thing you would lose compared to a virtual filesystem is the ability to show/list files that aren’t currently synced, but maybe it would be an interim approach that’s easier to implement ??

0 Likes