Delete files not accessed in X many seconds/minutes/hours/days/weeks/months/years on android?


Recommended Posts

Obviously mobile phones don't have the kind of hard-drive space that full fledged PCs have, which is why I'm asking if there's a way to ask BTSync to delete files that haven't been accessed in so X much time, to save disk space.

By delete, I mean locally, not on all clients. Currently the only way I can think of doing it is using one of the servers to 'move' the file away, then back in, if it knows the android has that file downloaded, but, it seems excessive.

Link to comment
Share on other sites

Hey there.

I guess that's not possible because the fileAccessTime isn't stored, at least when using one of the ROMs I tested.

The only parameters you have are fileModificationTme and fileCreationTime. But those don't help you.

If you feel like using fileModificationTime is for you, then you can use any "cron" app of your desire. Search the google play store, there are several of them. Simply write a short "find" which deletes old files and run it every couple of hours.


find /data/sdcard/btsync/share -type f -mtime +3 -exec rm {} \;

But since write actions of sd-cards is said do be limited (to be honest, I haven't seen a single dying ever, but ...), I would suggest to not go this way.

Ontop of that: This might be something for the Mobile Wishlist thread? Maybe you can figure out kind of a process/workflow which makes btsync aware of active/used files and internally handles storage management?

I tried to explain such a thing in my last post in the Mobile Wishlist thread, it's related to mp3 files, or media in general. This might be achievable becaus the Android media library is the very central API more or less every media app (images, sounds, videos) uses. But you're talking about file types that aren't covered by the Android media library, things might become difficult.

I know that my post isn't exactly what you're trying to do, but if you have a better idea, add some comments there please :).

Regards,

Stephan.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.