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
New Approach to Move Cache dir to external SD #4957
Comments
As I ran into diskspace issues last night I was close to get rid of c:geo and move to locus last night... so glad this came up again. I am eager to see a solution to have c:geo on the real extSDCard! too much issues here and I think if someone can identify the difference between emulated and extSDCard we are not talking about a "normal" user who must be protected because otherwise the app gets blamed. Moving files: would it be possible to trigger the following cascade: a) 1:1 copy from internal to extSDCard Garbage removal: May add this as an internal cleanup service / menu item which could be triggered at any time from the settings menu. Would prefer to separate this from the moving part. |
@Cappa-d |
Yes I would highly appreciate that. Thank you very much for coming back to this. First my thought was, that the topic will get less important as the amount of memory in the device is also increasing with new models. But current user reports show, that also the amount of cache data is rising (more caches, more pictures, etc.) and a lot of users still complain about too less space on their internal disc.
Do we need a "Cancel"?
Might remove the amount of unneccesary data to be moved, so yes. And we already have such a function which does only need to be called.
I think those two options One remark: |
No, but the process might be interrupted.
But we cannot write to other directories. AFAIK there are some ways to bypass this limitation, but I've never looked into detail for this.
|
My impression from the previous discussions was, that we agreed to decouple database storage and backup from geocache-related file storage.
and cache files in:
and backup will always go to:
Given this, in my opinion it is not necessary to put too much emphasis on the transactional nature of the move process. I would say, change the setting, then start moving (this could even be optional). If it is interrupted, then you would have to re-download a couple of images, not a big deal IMO. |
@SammysHP DB on external should no longer be a separate but combined with the general setting. Of course all possible migration cases have to be handled. This would make the last two questions obsolete. For removing SD while data is stored there we already had a good approach in another thread AFAIR. |
@rsudev Once this is working we can work on the details of all the other folders/files we are generating. |
Could we made backup to online serves? Gmail, dropbox, seafile, ... |
@SammysHP |
If we make backup target an independent location (like /sdcard/cgeo/backup) always, I am fine with whatever approach, even though I do not buy the database size argument. |
I have to modify my last statement slightly: I would like to retain the possibility to keep the database in appstorage, regardless of any setting for the cache directory. |
Let me try to summarize before this thread will get too long:
I hope I did not forget an important thing. |
Only think is. On my HTC the internal space is /storage/emulated/0/ and SD card is on /storage/ext_sd/ |
Should be no problem at all: |
Nope.
I've seen DB files with more than 200 MB and users complaining about not enough free storage space. |
Making backup address a new and different directory on sdcard/internal as a preparation step sounds like a very good idea. Issue created: #4963 |
We should not mix up database file with cache directory. This should go into another issue. So one step going before this can be implemented is to separate cache directory path from db file path. |
Yes. Just as a feedback: I already prepared the current master on my local repository and downloaded all the new APIs. :-) |
Should we migrate the cache dir to visible "cgeo" subdir (without leading dot)? |
Simply put a |
Because no one answered my question here: Should we migrate the cache / backup / db dir to visible "cgeo" subdir (without leading dot)? |
Without dot... as our target design might be, that those files stored there should be accessible by the user without a problem lateron. |
I added a section about GPX import/export to the Wiki "Target structure" page. |
@marco-dev |
Another idea: WebRTC |
At work 7:20 |
I took the time and installed the corresponding the debug build based on this PR from CI. Before installing the debug version based on this PR I did the following:
Afterwards I created a backup copy of all the data in the file system I produced while doing this. Now I analyzed the new status of the app and files as follows:
Conclusion:
|
Additional remarks:
|
[21:53] I can confirm it is still working after the failed switch: |
[22:04] Regarding the database: i think you mixed up something here. I try to explain: |
Summary of open issues:
|
I tested the updated PR once again with following result:
For moving the Here is the log:
|
Not to forget: |
@pstorch:
For me this is all OK but seems different to the Wiki description. |
Ok, that means that a File rename does not work across mount points. I have to change it to a real copy to the target and delete of the old. |
If you want to check the DB from internal storage via adb: https://gist.github.com/15b5d237a65e833a4c40856e2ab7dc38 |
But in the case of DBonSD is active, the Wiki should either read |
See here: |
Ah, yes. Thanks for looking it up. It's like I suspected. Will change it accordingly. |
I've now implemented a fallback to copy+delete the geocache data directories if the rename doesn't work. So we have the fast move, if it is on the same mount point and the longer copy+delete else. |
Thanks @pstorch |
@Lineflyer fingers crossed ;) |
I tested the latest status of the PR as of today with following result:
Also moving the GeocacheData from internal to external SD works now without a problem. Moving the DB from internal to extenal also works as described in Wiki. So from testing / usage perspective its good to merge to As just discussed on IRC it might be helpful to implement some Remaining tests like SDfull, SD removed, Huge amount of caches will be tested in a next step. Great work @pstorch |
Hi together,
I would like to try a new approach moving cache dir to external sd like Locus does.
Please vote for or against a new approach.
Choices for user:
The files should be moved by c:geo with progress dialog.
We already have a function to remove garbage from cache directory.
I suggest to remove garbage before moving files.
Open questions, please give your feedback:
The text was updated successfully, but these errors were encountered: