Hallo everybody,
I have an ARM based Synology NAS and I would like to use git annex to replace the "backup" solution provided by Synology. The basic idea is that I want files in a safe place when the house burns down or they get removed by accident.
Since I only care about the latest version and want to make really sure local programs (cifs service, photostation and so on) do not run into trouble caused by symlinks, I guess direct mode is what I want. I have been tinkering around and things seem to be working for the most part. A few questions remain:
Assuming I have all files synced to glacier and then accidentally remove all content and try to recover with the bare repo - with metadata but without content. the situation looks like this.
➜ syno-archive git:(annex/direct/master) git annex status test.txt
D test.txt
➜ syno-archive git:(annex/direct/master)
I try to get my files back out of glacier:
➜ syno-archive git:(annex/direct/master) git annex get test.txt
get test.txt (from glacier...)
ok
(Recording state in git...)
➜ syno-archive git:(annex/direct/master)
Contrary to my expectation, text.txt did not appear on disk.
Given the bare repo, you would one recover all content (thousands of files)? I expected "git annex get --all" to do the trick.
PS: This is from git-annex version 5.20141125
regards Andreas
Your status shows that test.txt is deleted.
git annex get
does not un-delete files, it just gets the content of a file (whether that file is deleted or not).You can use normal git commands to un-delete the file. Ie, "git checkout text.txt". If you're using direct mode, you can't use such commands, but can use "git annex undo" to undo a deletion.
Normally, if you have a bare repo, you'll want to clone it to get a non-bare repo. I suspect you did something else that resulted in your repo being in this state were files are deleted.
Actually, I just removed all annexed files to try out disaster recovery. I stumbled across the
undo
command. Unfortunately, it does not seem available on Ubuntu running version 5.20141125 shipped by vivid (git-annex: Unknown command 'undo'
).Am I missing something, or how do I get a version supporting
undo
?thanks Andreas