sync only files older than x days

I want to 1w-sync my phone’s camera folder to my pc, but only files older than 3 days.

Why? Let’s be honest: only one image out of every 20 snapped is a keeper - on a good day. So I need those 3 days to remove images before they are synced to the pc.

How do I set this up in st?

Syncthing doesn’t have such capabilities built in, unfortunately.

I assume the files have timestamps in their names, so it should be possible to hack around some kind of a script quite easily that would automatically add those created in the last three days to the ignore patterns (or, in reverse, ignore everything and exclude only the older files).

Running the script on the phone may be tricky though. Not sure if even possible without root. You would likely need an application like Easer/Tasker/Automagic or similar to run the script in background, perhaps periodically or by monitoring the folder.

Alternatively, you could set up the script on the PC, which likely has many more capabilities of running background jobs on schedule, but this is assuming that there is only a single computer that the photos are synced to. If there are multiple, then the script would need to be run on the phone itself.*

In sum, probably possible, but not simple.

*Unless you sync an #include file with the ignore patterns located there, but doing so does add to the overall complexity a little too much, at least for my taste.

1 Like

Or, you just sync everything and when you remove the files from the one side they are also removed from the other.

3 Likes

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