0

I have a large collection of photos (several TBs of data) that I have stored in OneDrive and synced to my local SSD. Due to the storage requirements, I do not really have a backup but just hope that OneDrive keeps my files save. However, I am a bit afraid that, due to some error in OneDrive, OneDrive deletes some photos and syncs these deletions to my local copy. Or maybe I accidently delete some subfolders and do not notice until it is too late. So I would like to have a tool that detects if some files changed (only if, not actually see a diff of the changes). I used to use git for that, but it

  • at least doubles my storage requirements since it has to keep a copy of all of the files
  • is quite slow for these large amounts of binary data

Since git diff is basically useless for binary files, I would be content with a tool like git status which just lists which files have been changed, added or deleted. This should be possible by simply storing hashes, not full file contents. Of course, git has the advantage that it can restore the deleted files, but I hope that, if I detect that a file is missing, I can restore it from Windows' or OneDrive's recycle bin.

Tobias
  • 43
  • 4
  • You can [compute the git tree hash id](https://stackoverflow.com/questions/6011172/how-to-compute-the-git-hash-object-of-a-directory) for the whole directory and compare that. No need to store the whole content in git. [This question](https://stackoverflow.com/questions/69730660/compute-git-hash-of-file-or-directory-outside-of-git-repository) might give some pointers. It seems calculating the tree hash outside of a git repository is hard, but you could probably create one temporarily for this task only. Come to think of it: maybe just storing the result of `git ls-files` is sufficient. – Joachim Sauer Nov 11 '21 at 09:29
  • I personally would avoid most of the OneDrive-type systems here and use a snapshot-driven file system like ZFS to store the images. Stored on a NAS box, with offsite backups in say an S3 bucket, the files would be pretty safe. – torek Nov 11 '21 at 15:20

0 Answers0