New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter for old WhatsApp backups #904

Closed
d4rken opened this Issue May 19, 2017 · 3 comments

Comments

2 participants
@d4rken
Owner

d4rken commented May 19, 2017

Since SD Maid beta v4.7.2 we have an "age" filter. This finally allows us to make a filter that deletes old WhatsApp backups.

@antonio-gil was so awesome to provide a first filter, see here.

I've made a more tweaks and the current version is this:
OldWhatsAppDatabaseBackups.scuf.sdm.zip
To import it, extract the zip file and import the .json file into the SystemCleaner.

What we need to test:

  • Does it match the correct files on all devices?
  • Using this filter, is the scan performance acceptable?

This is how it works

  • All targets must be a file.
  • All files we want to delete end in db.crypt12.
  • The target must begin with msgstore-, note the trailing slash as the current backup also doesn't have that.
  • We use pathContains and locations instead of mainPath so that it's also possible to match pathes like /storage/sdcard0/WhatsApp/... as well as /storage/emulated/0/WhatsApp/... etc.
  • The file must be a minimum of 1 day old (24 * 60 * 60 * 1000).

The filter looks like this

{
  "version": 4,
  "label": "Old WhatsApp Backups",
  "description": "Message backups older than 1 day.",
  "identifier": "61d71937f87c.scuf.sdm",
  "color": "#075E54",
  "targetType": "FILE",
  "possibleNameEndings": [
    ".db.crypt12"
  ],
  "possibleNameInits": [
    "msgstore-"
  ],
  "pathContains": [
    "/WhatsApp/Databases/"
  ],
  "locations": [
    "SDCARD"
  ],
  "minimumAge": 86400000
}
@antonio-gil

This comment has been minimized.

antonio-gil commented May 21, 2017

Awesome!

Thanks for the tweaks and the explanation!

And, perhaps, for improve the UX, it could be a good idea to use an alternative to the milliseconds. Specially with lapses bigger than a day or two.

Using the WhatsApp example, there can be backups made on weekly or monthly basis, and at least IMHO, calculate the ms of such time span is not so accessible... Of course! I can be wrong, and it's just an "issue" for me.

So, what do you think?

@d4rken

This comment has been minimized.

Owner

d4rken commented May 21, 2017

And, perhaps, for improve the UX, it could be a good idea to use an alternative to the milliseconds. Specially with lapses bigger than a day or two.

Miliseconds is the finest resolution that is possible. Of course I can change that to hours or days, but maybe someone else needs this kind of accuracy. So we would probably need a few additional UI elements to allow entering different time spans days/hours etc. It would be nice to have, but would it be worth the effort? Maybe something for the lower end of the TODO list 😉

@antonio-gil

This comment has been minimized.

antonio-gil commented May 21, 2017

Yeah, I totally agree.

@d4rken d4rken closed this May 25, 2017

@d4rken d4rken added the help wanted label Jan 24, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment