Serdar Cevher
Oct 6, 2023

Nice concept Doğancan, I was regularly thinking about this.

But I believe we can slightly improve it with a date filter because this version might cause some issues.

Say you take a screenshot at 11:59: It will be deleted in a minute. Or you're looking for a screenshot you had just taken yesterday but it's already gone in less than 24 hours.

So if we modify the cronjob (as below), only old enough files will be handled and the new ones will be kept for a while.

`0 12 * * * find ~/Desktop/Screenshots/ -type f -mtime +7 -exec rm -f {} \;`

(mtime +7: modified more than 7 days ago)

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Serdar Cevher
Serdar Cevher

Written by Serdar Cevher

Developer of web & mobile apps | Co-founder: Off2Class, Auglinn | Founder: SmarDish, tarifmotoru.com, valizim.com | Ex columnist @PCnetDergisi

No responses yet

Write a response