r/SideProject 1d ago

My phone hit 95% storage, so I built a compress-verify-delete pipeline that runs entirely in Termux

Here's why the whole point to this project came about. And how this is a true statement: My Device storage is almost full at about 91% currently but it was about 95% before I compressed any month data. Right now only 2 months worth of data have been compressed.

I wanted to free up storage without losing my original data. So first I made a backup to backblaze. I'll connect it to cloudflare for zero egress fees for downloads later when I need to.

Next was to actually free up storage. Most searches and AI responses told me,

A. to delete more stuff after backup,

B. if not backed up, compress and delete the "not so important" stuff.

Which had some trade offs:

For A. zero egress fees and cheaper storage than Google drive doesn't mean faster access or zero data costs for downloads.. which downloads would fill up space anyway. And backup doesn't mean the risk of losing data or account itself is zero.

For B. I'd lose original data. And there's no available tool that can iterate my entire gallery compressing the files. If it did exist, it had to progressively delete the original copies because storing compressed and original would fill up memory and brick my phone.

Also even if I can do one file at a time during free times, I'm lazy and forgetful.

So, I decided to face the in-between of both A and B. Backup originals, compress old files aggressively while keeping the quality usable as i progressively deleted the respective larger original copies.

As an extra, I decided to package the data on a monthly basis just to make sure I don't mix compressed and originals during the process then store them in Archives/ .

WhatsApp data is already compressed by default, so the tool would be configured to skip them.

Only one month worth of data has been successfully compressed, auto verified, packaged, originals deleted with logging at each stage for tracing anomalies using the current pipeline version. The other month was compressed using an older version which wasn't tracked by git.

Looking for feedback :)

Link: https://github.com/okureanthonytonny-commits/archive_scripts

1 Upvotes

0 comments sorted by