# Ignore files older/younger than date

**URL:** https://forum.syncthing.net/t/ignore-files-older-younger-than-date/19270
**Category:** Support
**Created:** [November 7, 2022, 1:47pm UTC](https://forum.syncthing.net/t/ignore-files-older-younger-than-date/19270 "2022-11-07T13:47:11Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![ciper](https://forum.syncthing.net/user_avatar/forum.syncthing.net/ciper/32/13069_2.png) [@ciper](https://forum.syncthing.net/u/ciper)
#### Post date: [November 7, 2022, 1:47pm UTC](https://forum.syncthing.net/t/ignore-files-older-younger-than-date/19270/1 "2022-11-07T13:47:11Z")

</div>

I am using synchting between two android devices. For a specific folder i would like to write an ignore config so that only files older than a certain number of days are synchronized. Is this currently possible or maybe a future ability? Thanks

---

<div class="post-metadata">

### Author: ![calmh](https://forum.syncthing.net/user_avatar/forum.syncthing.net/calmh/32/15311_2.png) [@calmh](https://forum.syncthing.net/u/calmh)
#### Post date: [November 7, 2022, 1:47pm UTC](https://forum.syncthing.net/t/ignore-files-older-younger-than-date/19270/2 "2022-11-07T13:47:35Z")

</div>

No, sorry, name based only.

---

<div class="post-metadata">

### Author: ![ciper](https://forum.syncthing.net/user_avatar/forum.syncthing.net/ciper/32/13069_2.png) [@ciper](https://forum.syncthing.net/u/ciper)
#### Post date: [November 7, 2022, 1:49pm UTC](https://forum.syncthing.net/t/ignore-files-older-younger-than-date/19270/3 "2022-11-07T13:49:53Z")

</div>

Thanks for the lightening fast reply. Is there a place to submit feature requests? For archival storage on slow media it would be perfect to have date based rules. This would also allow recent files younger than a certain date to be kept on faster (more expensive) storage

---

<div class="post-metadata">

### Author: ![tomasz86](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/t/96bed5/32.png) [@tomasz86](https://forum.syncthing.net/u/tomasz86)
#### Post date: [November 7, 2022, 1:53pm UTC](https://forum.syncthing.net/t/ignore-files-older-younger-than-date/19270/4 "2022-11-07T13:53:34Z")

</div>

This has already been proposed multiple times (and rejected). I’d suggest to write a script that would simply add those older files to the ignore patterns automatically, and then set it to run periodically.

---

<div class="post-metadata">

### Author: ![ciper](https://forum.syncthing.net/user_avatar/forum.syncthing.net/ciper/32/13069_2.png) [@ciper](https://forum.syncthing.net/u/ciper)
#### Post date: [November 7, 2022, 2:00pm UTC](https://forum.syncthing.net/t/ignore-files-older-younger-than-date/19270/5 "2022-11-07T14:00:18Z")

</div>

The types of files im using it for currently are small and numerous so a script could work but wouldn’t be as robust or elegant as a date filter.

As a new user I wasn’t aware this had been previously discussed. However if people are still showing a desire for such a feature I hope the development team would give it a second consideration. It could be implemented in the gui rather than the ignore file if that makes a difference

---

<div class="post-metadata">

### Author: ![calmh](https://forum.syncthing.net/user_avatar/forum.syncthing.net/calmh/32/15311_2.png) [@calmh](https://forum.syncthing.net/u/calmh)
#### Post date: [November 7, 2022, 2:04pm UTC](https://forum.syncthing.net/t/ignore-files-older-younger-than-date/19270/6 "2022-11-07T14:04:11Z")

</div>

> [@date/age ignore pattern](https://forum.syncthing.net/t/date-age-ignore-pattern/13042):
>
> 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-fol…

> [@Filter files by properties like size, age etc.](https://forum.syncthing.net/t/filter-files-by-properties-like-size-age-etc/2362):
>
> Continuing the discussion from [Excluding files from synchronization (ignoring)](https://forum.syncthing.net/t/excluding-files-from-synchronization-ignoring/80/24):

> [@Feature requests: symlinks, include list, more filter options](https://forum.syncthing.net/t/feature-requests-symlinks-include-list-more-filter-options/17808):
>
> I’d like to make three suggestions for inprovements: 1. Symlinks: I know that following symlinks can be a security risk, but on the other hand, it would be a great relief in many cases. E.g., if there’s a directory containing 100 sub-dirs, of which you need to sync just 10 directories. You can, of course, create 10 pairs of dirs to be synched. This will work, of course, but it any of those 10 dirs needs to be swapped by another, you will have to delete one synched pair and create another one. …

---

<div class="post-metadata">

### Author: ![tomasz86](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/t/96bed5/32.png) [@tomasz86](https://forum.syncthing.net/u/tomasz86)
#### Post date: [November 7, 2022, 2:06pm UTC](https://forum.syncthing.net/t/ignore-files-older-younger-than-date/19270/7 "2022-11-07T14:06:26Z")

</div>

Yeah, you should be able to find all the older topics if you search the forum for “ignore date”. I wouldn’t have hopes to have this implemented personally 😉.

When it comes to the script though, a possibly clean approach could be to include only younger files and ignore everything else, e.g.

```nohighlight
!file1
!file2
*

```

and so on. A possible problem with this approach is that when one of those included files becomes “old”, there is no simple way to delete it on remote devices only while also keeping a local copy.

---

<div class="post-metadata">

### Author: ![system](https://forum-uploads.syncthingcdn.net/original/2X/0/0b50e0a202b22ae6a67190759e8c868805b8ed9f.png) [@system](https://forum.syncthing.net/u/system)
#### Post date: [December 7, 2022, 2:06pm UTC](https://forum.syncthing.net/t/ignore-files-older-younger-than-date/19270/8 "2022-12-07T14:06:29Z")

</div>

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