You are not logged in.

#1 2017-06-30 21:23:29

catnap
Member
Registered: 2016-10-03
Posts: 131

[SOLVED] Version control for ebooks, music, and pictures

I have fallen into the habit of keeping my code neatly under a version control. This can easily be accomplished by Bazaar and Git. Having a system of version control like this, allows me to easily synchronize my code between multiple computers and external hard drives. However, the problem becomes more difficult when dealing with ebooks, music, and pictures. These files take up so much space that version controling them is not efficient. Indeed, I have tried to put these files too under a version control system for the purposes of synchronization but this only resulted in the .bzr/ directory taking up unnecessarily large quantities of space on my hard drive.

Is there a way to "version control the file hiearchy", so that the version control keeps track of new files, deleted files, and renamed files but does not store information about the contents of the files apart from verifying by a checksum that the files have not changed?

Last edited by catnap (2017-07-02 00:41:07)

Offline

#2 2017-07-01 07:27:15

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,275

Re: [SOLVED] Version control for ebooks, music, and pictures

rsync?

Offline

#3 2017-07-01 11:33:58

catnap
Member
Registered: 2016-10-03
Posts: 131

Re: [SOLVED] Version control for ebooks, music, and pictures

RSync is a very potent solution to many of these synchronization problems. But I wonder if it is able to update the file hierarchy between two systems. I have sometimes used the --delete switch to achieve a comparable effect but this incurs the risk of losing data when neither one of the systems is unequivocally more up to date than the other.

Offline

#4 2017-07-01 12:01:06

twelveeighty
Member
Registered: 2011-09-04
Posts: 1,456

Re: [SOLVED] Version control for ebooks, music, and pictures

catnap wrote:

one [...] is unequivocally more up to date than the other.

Please explain what it is exactly you want to achieve with some examples on when rsync wouldn't produce the desired outcome? For me, being "up to date" is a binary thing: it either "is" or "isn't", there's no grey area in between them.

Offline

#5 2017-07-01 13:14:17

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,275

Re: [SOLVED] Version control for ebooks, music, and pictures

I assume conflict resolution (git merge), ie. when syncing systems A and B:
A/file1
A/file2
B/file1
B/file3

with A and B having mtime after the last sync.
=> Do you want to remove A/file2, B/file3, both or keep both?
This question is not dealt individually with by rsync, but controlled in global by whether you pass the --delete flag and which way you sync first.

This would lead to the question whether this is actually supposed to be a VERSION control system (the general rsync approach here is to cp -al the last backup) or rather a 5 line bash script that compares two directory trees and then asks for every deviation what to do with that file and either cp or rm it on either side.

Offline

#6 2017-07-01 13:47:10

x33a
Forum Fellow
Registered: 2009-08-15
Posts: 4,587

Re: [SOLVED] Version control for ebooks, music, and pictures

I remember hearing about a backup tool based on git. Upon searching a bit, I think it was bup: https://github.com/bup/bup

Offline

#7 2017-07-01 18:55:58

catnap
Member
Registered: 2016-10-03
Posts: 131

Re: [SOLVED] Version control for ebooks, music, and pictures

twelveeighty wrote:

Please explain what it is exactly you want to achieve with some examples on when rsync wouldn't produce the desired outcome? For me, being "up to date" is a binary thing: it either "is" or "isn't", there's no grey area in between them.

A fair question. I think seth's answer is directly on the mark. You could need to synchronize two directories, each of which has been changed after the last synchronization. In this situation the --delete flag causes a loss of data.

x33a wrote:

I remember hearing about a backup tool based on git. Upon searching a bit, I think it was bup: https://github.com/bup/bup

I know that the forum is not for software recommendations. But just between you and me—thanks for the software recommendation.

Offline

#8 2017-07-01 19:43:41

catnap
Member
Registered: 2016-10-03
Posts: 131

Re: [SOLVED] Version control for ebooks, music, and pictures

seth wrote:

This would lead to the question whether this is actually supposed to be a VERSION control system

Version control for this situation might not be the traditional thing to do. But if the user wants this functionality, I do not see a problem in the aspiration. I also think, it is something that can practically be achieved, although the program for it might not yet exist. In any case, I could use some details in the simpler solution that does not entail a full version control. Is the aforementioned five line script available somewhere online?

x33a wrote:

I remember hearing about a backup tool based on git. Upon searching a bit, I think it was bup: https://github.com/bup/bup

I tried out bup and it will surely be useful for making backups. However, it seems like the program is not exactly what I need. As the name suggests, it is mostly for backing up data rather than keeping two file hierarchies synchronized.

Offline

#9 2017-07-01 21:31:01

catnap
Member
Registered: 2016-10-03
Posts: 131

Re: [SOLVED] Version control for ebooks, music, and pictures

A program called git-annex seems optimal for version controling large files. I'm trying it out and have had nothing but success so far. See http://git-annex.branchable.com/ for details.

Offline

#10 2017-07-02 06:03:34

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: [SOLVED] Version control for ebooks, music, and pictures

Version control implies the need to keep a record of every single state, forever. All you really need is a file sync software which can sync the latest version of a media file to all devices, while deferring to the user whenever a file was modified from two locations without being properly synced.

Essentially, you want Dropbox or perhaps Owncloud.


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

Board footer

Powered by FluxBB