Skip to content
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

Unable to restore from backup #82

Open
shankargopal opened this issue Jan 24, 2023 · 6 comments
Open

Unable to restore from backup #82

shankargopal opened this issue Jan 24, 2023 · 6 comments

Comments

@shankargopal
Copy link

shankargopal commented Jan 24, 2023

Thank you for this wonderful program!

I am running asd to sync the config directory of Franz. This is ~/.config/Franz. My laptop frequently crashes from low battery (it's an old laptop :) ) and I've had asd and profile-sync-daemon recover well a few times. This time I may have opened Franz too early, when it was still recovering. The result is that now the Franz profile seems to be bad.

I followed the instructions in the wiki to manually restore a snapshot. In my case I run:

sudo systemctl stop asd
ls ~/.config

There is a directory Franz and a few snapshots. Following the instructions in the wiki, I do the following:

cd .config
mv Franz Franz-bad
tar -xvf <snapshot file>

When I then run sudo systemctl start asd, it fails. The error is that it cannot find /home/{USERNAME}/.config/Franz.

Now what should I do? If I create a blank directory named Franz, the application starts as if it is starting with a blank profile. If I keep this and then try restoring from snapshot again, after stopping asd, I get a mixed up state.

How do I restore from the snapshots saved on my system? It seems like the instructions don't work?

@manorit2001
Copy link
Collaborator

Hi, ideally the snapshot file should have the last state that was working for it, since the time to take backup is actually long there can be cases of corruption like in your case ( when you opened Franz while it was still taking backup ), i've tried to think of some way to avoid it ( and minimise as much as possible ) but keeping the idealogy of less HDD writes actually makes it a bit difficult to implement, there will always be tradeoff for this scenario.

If any of your snapshot files ain't working then am not very hopeful that you might get your data back, might be a good idea to only use this for non important stuff as the working of backups is still a difficult thing to implement. Will think of some way to avoid it

@shankargopal
Copy link
Author

shankargopal commented Jan 25, 2023 via email

@manorit2001
Copy link
Collaborator

Hi, the wiki is actually old. With the current update the backup directory will actually be in place itself and you won't need to do anything, just to keep the state of backup directory we take those compressed backups. You need not move anything. The Franz directory that you have is the one that you require.

@shankargopal
Copy link
Author

shankargopal commented Jan 25, 2023 via email

@manorit2001
Copy link
Collaborator

So if you keep the backups enabled, what is does it it takes the state at which the current directory is and makes a compressed tar of that folder incase of an abrupt power down, but this happens when the computer next boots up. So essentially whatever folder you had should had been backed up in that tar file ( asd p should show you the backup files ) which when uncompressed should give you the output directory that you want.

It's not required after the new version change anymore but is just a failsafe trying to keep atleast some data before any furthur corruption by some other program that might use the folder after the abrupt power down.

@shankargopal
Copy link
Author

shankargopal commented Jan 25, 2023

Ok. I did try the following:

[closed Franz]
sudo systemctl stop asd
cd ~/.config
rm -rf Franz
tar -xvf <snapshot>
mv .Franz-backup_asd-old Franz
sudo systemctl start asd
[restart Franz]

And it still came up in an inconsistent state. But this may be because of some caching issue as well - I did not restore the cache which also was under asd syncing, my bad.

I could try with that, but I've now decided I don't want to potentially risk messing up the integrity of the original messaging client - not sure if that is possible - so I think I'll just let it go for now.

I just wanted to check if the above is done right, as per what you said? If so perhaps I can submit a PR for the README so that the instructions can be updated? Of course would make the instructions generic (i.e. using foo bar instead of Franz).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants