Episode: 1643
Title: HPR1643: Unison Syncing Utility
Source: https://hub.hackerpublicradio.org/ccdn.php?filename=/eps/hpr1643/hpr1643.mp3
Transcribed: 2025-10-18 06:15:47

---

It's Wednesday, 19th of November 2014. This is in HDR Episode 1643 entitled Unison Sinking Utility.
It is hosted by 5150 and is about 35 minutes long. Feedback can be sent to 5050 at linuxpacement.com
or by leaving a comment on this episode. The summary is review on the Unison Graphical Sinking Utility.
This episode of HDR is brought to you by AnanasThost.com.
Get 15% discount on all shared hosting with the offer code HDR15. That's HDR15.
Better web hosting that's honest and fair at AnanasThost.com.
Howdy folks, this is 5150 for Hacker Public Radio. And with your permission I would like to dedicate this podcast to the memory of my father Colonel Jack W. Greer,
who recently passed. And if we could just take a moment and remember it's, I would be very much appreciative.
Thank you General listeners for that indulgence. I know that's not why you tuned into this podcast.
But I just wanted to take some time for you folks to regular listeners to my contributions to Hacker Public Radio.
Then you already know that my father and I had recently suffered some huge changes to our lives.
We lost the house to a fire a couple months ago and dad's been in rehabilitation recovery center not firm any injuries caused by the fire.
But this I didn't need to keep him in a facility for a while and I had him back home in a apartment house I'd rented for about a week.
And I noticed some deterioration in his health and then one evening I woke up and I thought well he must be doing a lot better tonight because I don't hear him audibly breathing there in the next room and then I lay there for about five minutes and realize something was terribly wrong.
And then I went in there and but you know like I said it's not what you folks tuned into here. I just want to share that with you because kind of always assume wrongly that the HPR community is made up of course the folks that I talked to all the time on Google+.
Plus or even Facebook or in the all class planet free node channel and it's so much more than that there's a lot of you folks that listen to the podcast and don't have the opportunity to participate interactively.
But you know you through my podcast I guess you've become somewhat involved in the recent ups and downs of my family life of the you know I'm sorry it's not my purpose to involve you but I did think in previous podcasts it was necessary to acknowledge some of the support that I've gotten from.
The podcasting community over the last several weeks and what can I say this last thing is just hit me like a dang truck.
But you know and people say well why do you want to do a podcast now during this time it's it's nice to have something else to do frankly.
I don't have to focus on it and really this is my third try at recording on this particular subject this is the limitations of this laptop I have now I don't know why it should be plenty powerful now and I've added the memory.
But it's the first time I record I didn't do a very good job side to do it again the second time I thought was perfectly good.
But going through and editing out the umbs and whatever the you know the system itself kept sort of just noping out in the middle and I think I've corrupted that second try too many times to go back and do it so maybe I can do it right this time.
Without so many things I have to edit costs in the middle notwithstanding.
All right so topic for today is the Unison graphical syncing program and for those of you who have to work in windows and yes I should.
I'm one of you that has to work day to day in windows and we can all have a little pity party later but probably if you're working for family members or for clients you may have used a.
Sicking utility called sync back which is you know it's just really great if you want to make one directory an image of another you know and one reason for doing that would be backups but the other reason like I had my homes home system for.
But I had two computers that I would do work on and with with similar files.
And I said at the end of the day I wanted to have my documents directory on those two computers as mirror images of each other including if I had conflicting versions of the same file on the most recent version.
To be on both computers so you kind of requires you have to have pretty good idea of what you've edited and when because of course if you have a file on on one system and you copy over documents on the other system and then you update that file on both computers independently then of course you wind up.
With new data in both those files that that you can't consolidate well you certainly open both file side by side and do it manually but there's no piece of software that's going to help you do that but in most situations.
You will have you will know that I have this file here and I have this file there and the file is there is the one that is most up to date and because it's most up to date it will have the latest date stamp.
So when you sync to sub-directories on different volumes hopefully then your most recent update will overwrite the older versions of the same file and if you have two folders of similar content but not the exact same files but stuff that you'd like to have grouped together.
On machine A and machine B then seeking those folders is also something that you would probably want to do so that's what unison does you you give it well it calls it a first directory in a second directory because it's it's going to sink in both directions so it's not like a target directory in a source directory.
Because what if you have two files of the same name whichever one has the latest date stamp is going to win and unison requires usually two packages to be installed unison and unison dash GTK the GTK version of course installs the graphical interface into the software.
So if you have two machines at least one of them is going to need the GTA GTK I'm sorry GTA I'm going to play a grand theft auto on here no GTK going to need the GTK package and of course if you're one of those people who
prefers one desktop to another and is very scrupulous about keeping the packages from one desktop off their system in favor of another desktop then if you're not running known then you probably
probably don't want to install the unison dash GTK because that's going to bring in all kinds of known type dependencies that you don't want.
But if you're one of those type of people that is so scrupulous with what they put on their system then I'm certain just by name by the name you will know that that's not something you want to run and I'm not I'm not telling you anything.
So for you folks jump to the next podcast probably because there's nothing more that you can do with this one.
But if you have two or more computers that you want to sync folders on I'm just using documents as my example is it is what I synced.
Now I would not recommend unless you have identical machines identical software that you would sync your home directory because you have different setups for different architectures and different desktops I don't think that would be appropriate in most cases.
Of course if you have identical machines you want to clone maybe you do want to do that otherwise you know probably what you want what you want to clone might be something in your documents directory.
And the first thing that you that you want to well I have a first I have step one in my notes let's call it step zero step zero would be if you have two machines two and you want to sync the documents between machine A and machine B.
First thing you're going to do is make the directory structures a machine and a machine B a perfect mayor of each other.
So in other words in some in some distros the documents folder starts with small D in most distros it starts with an uppercase D.
And really I don't know if that makes any difference at that level because those are the target directories but just for the sake of argument let's let's agree make both of those capital D for documents or lowercase D whatever you want to do.
And then all your subfolders if you have similar documents in subfolder or machine A and and another similar similar documents in the folder machine B.
You probably want to change those folder names to be the same and well when I first did this I had my big desktop replacement laptop in my office.
And where I borrowed I always thought I was told myself I'll get this laptop one that he's refurb it wasn't that expensive but yeah I'm going to get this because I'm going to carry it around with me and I only carry that big 17 inch laptop on a couple of jobs I found a smaller laptop that was a lot more convenient to touch around with me.
So for all intensive purposes the 17 inch laptop became a desktop but on that I think I had recipes recipes that I wouldn't counter the recipes that I couldn't just link to that I had to copy into a file for some reason.
But real world example the two machines I wanted to sync one of them I had under documents recipes of capital R and the other one I had recipes with a lowercase R.
So of course you know if you seek them like that because Linux is case sensitive in file names I would had two recipes directories one for capital R one of lowercase R it's not what I wanted.
So I had to go through and decide what capital R lowercase R think of the side on lowercase R to really make any difference but so you got to go through and standardize and I had a folder for family stuff.
Well I had I think I had the family stuff and the farm stuff on one folder on each computer and then I of course I had my consulting stuff so I had to name it so when I did a sync all that stuff would be combined.
And at the time I also had so I had the two computers that really never left the house I had the 17 inch desktop replacement laptop back in my office and then I had the computer that set on the dining room table which I never really expected to use that much
except during meal times it's just you know that was computer is going to put the recipes up on when I was cooking but also you know so I could fall IRC and you know surf the web while I was eating et cetera that's that's where I you know I started out with a laptop on the kitchen table.
I'm starting to laptop a tablet my price start out with the phone and had IRC up I start off then I had a tablet then I had this little low powered wax was when the original windows tablet so HP computer it was it was earlier than what we call net book but it was about equivalent and power to a net book.
I had a trans media processor so there are some applications and Linux it just didn't run a VLC wouldn't run so if I want to listen to tilts I had to listen to it through a browser which wasn't that much of a yeah inconvenience but you know that's how I did it and eventually I saw online this former point of sale system that was kind of neat because it's going to sort of scale to frame kept the whole.
The other thing up off the table and I put a swivel under it and all that so you had a small form factor computer on one side of this frame and then you had a 17 inch square monitor on the other side and so I said the whole thing up on a turntable and add a keyboard and mouse and you know it did it just work slick for a I've talked about this before but it works slick for.
You know if you knocked over your T class and spilled stuff all across the table everything was up off the ground is not like a laptop sitting there was going to just suck everything right in so and I found that that was spinning.
Yeah I was doing a lot of productivity things on this dining room computer that I never expected I would be doing I figured well I'd have it running during meals and if I would go do something I'd go back to the computer 17 inch laptop in the office well didn't really turn out that well I was doing most of my stuff on the dining room computer.
So I would I would sink those to the entire documents directory because you have to have like I said first step is make your documents directory Mary image of each other and then I had this really neat I thought Panasonic titanium shield tough book about 11 1 1 2 inches that I wound up actually taking around with me to jobs.
And now it I didn't want to sink the whole documents director I just want to sink my client information in other words well I always have a file for clients with their with their passwords with with their account information with their credentials for any software they had installed so if I had to go back to the software vendor of any questions I could.
Prove that we actually the client actually had a license for the software of course always always make sure the client had a copy of that but you know how it is clients never have that stuff so you got to maintain it yourself you just got to so that stuff I I would of course usually I was updating that most of the time on that little laptop that I carry around with me but you know thing was clients would call.
You in the middle of the day and you and you didn't want to get that little laptop out of the case and fired up to be able to tell them something so you want you want to have their information available to you on whatever workstation you were on so this is you know this part of the sink I would you know I would sink the little laptop to the big laptop and then sink the big laptop to machine in the dining room
and then I would I would have all my client information on all machines I would likely to be on and I did that now I told you when you when you stole unison you can install just unison and not the GTK but any seeking operations have to be installed from the graphical client so if you have a headless server with no graphical component you can install unison on it.
And pick a directory and sink all you know wherever you want to it and then you'll be backed up on your server but just as you can't initiate those operations from the server side.
Okay network backups you know if you're going to cross the network it's a great thing about use if you have unison on two machines on your network then you don't have to share or want to call the target drive but you know use and call the drive one and drive two or first drive and second drives what unison calls it.
You don't have to have that remote drive actually shared you know through Samba or NFS or through SSHFS or whatever it doesn't have to be shared it just has to be out there on the network and really access it pretty much like you would if you were to issue an SCP command we'll get to that.
But if you're going to do network backups it's strongly recommended that you install either RSH or SSH client and server on all your machines participating in the backup and of the two of course SSH is preferred because that has the stronger security and you're probably already wondering okay why go through all this graphical stuff why you know why not just use.
Well when I went to research the RSH command I really didn't find any way for to do a bidirectional sake it you know it's more like a copy command of course RSH always newer file will override the older file but only goes one direction if you are sent directory A to directory B the newer files and directory A will override the older files and directory B of the same name.
But the newer files of the same name and directory B will not override the older files and directory A you could go back to the other direction and do an RSH directory B to directory A to do that.
Plus you have our SQL automatically pick up and files it's a lot like CP and in that you have to do hidden files separately plus in less your rejects a lot better in mind you have to handle files with the extensions separately from files without an extension so you're going to go like files of annex and you're going to go star and then.
Files with the extension or star dot star so you wind up you have three separate RSH commands going one direction and three separate RSH commands coming back the other direction that might be really more efficient in the long run but still I think using unison is a lot easier to follow.
Okay I guess I already talked about it. I said my step one was making your subfolder structure the same on both machines blah blah blah I've already talked about that okay next step you need to launch unison and create a backup profile so you have to sign the profile name and you have to select a synchronization kind whether it's local SSH RSH or TCP and I explain that local would be.
Optimally say well it would be another volume on the other director could be two directors on the same volume but I can't I wouldn't understand the point in that so director on local machine directory and one volume director in second directory on another volume say a usb backup drive something like that that's what that's intended for or.
The thumb drive and in fact you will get to the point where it's going to ask you if you if either of your drives are four man is fat so that is an anticipation of backing up the thumb drives or two USB hard drive because USB hard drives are usually formatted as fat by the factory because that's the only universal file system.
Between different architectures that we have unfortunately now you can be pointed out that local would include if you have an external hard drive say out there on the network on another machine or on as box or something like that if you have that mounted why install unison on both boxes just install unison on your local client and use it to copy the files we could.
But the thing screams out to me is that is well if you're doing things local that it's it's not going to be encrypted whereas if you select one of the network tools you can select ssh and have your files be encrypted going across the network and as I said ssh is considered to be more secure in rsh and TCP that would be completely out in the open no encryption.
So that's not all recommended. So you have to select your first directory and that's that's assumed to be local on your on the system you're running and then if you selected local synchronization you'll be then you'll be asked for second directory if not if it's a if it's a network folder you've got to go through a few more steps and first step of that you tell the host machine and you can either give it the name or the IP address and you can either give it the name or the IP address.
And I've had I've been having to use IP currently I'm I'm using the default Cox router which I probably shouldn't be using and and Wi-Fi and I've tried to go in and through through DHCP assigned static IP addresses to my host machines and it's completely ignoring that I don't know why.
But it is it it's it's assigning my machines IP's dynamically but it is tending them to assign them to same IP each time. So that's not so bad. So host machine is rather the remote machine I'm using since my server you know I an actual rack mounted server back at home I left it home because it just you can't use it inside the same building where you're trying to sleep I'm sorry.
But so my destination my second directory is on a pinion for that I brought with me and set on the network.
And so I'm using IP address that the router signs to it right now because I gave I gave it a host name and does that doesn't seem to be recognized and you're you have to give it the user name for your count on the remote machine of course.
And before it actually runs the sync if you haven't registered your SSH keys between the two machines and of course you're going to get prompted for a password every time you want to do a sync there's a check box for whether you want to use compression.
So if your is a trade off if your processor is slower than your network then actually you know actually trying to compress files maybe more overhead than it's worth but most cases it's probably not.
Okay then if you're going for a network destination be asked for the target directory or second directory.
And you're going to have to you've already asked for the host you're going to have to type in the full path you can't browse to it so you have to type in slash home slash user name slash directory name etc.
And this is the next step is where you're going to tell unison of either folders using fat like I like I said if you're if your target is a flash drive or a an unreformatted USB drive then probably it is fat.
Let's see and my notes on reiterating stuff I've already talked about if you're back to another system use and needs to be on both you don't need the GTK on the target system but then you you know you're going to be limited to initiating your
sinks from only the systems with with a graphical interface.
And so you should be done creating your profiles you select and run it and the first time you're going to get a warning that no archive files exist and those are index files that are created the first time that you run a sink that helps
systems to see which files have been updated since the last sink so it it's it speeds up the sink operation by having those index files there.
So if you it's expected to get a warning the first time if you get it from then on then you're going to have to wonder what's eating your index files.
And of course the unit is going to look for differences in the timestamps between first directory which is going to be represented in the left hand column and the second directory which is going to be represented in the right hand column.
And it'll it'll take a while to run probably through all those and it's not going to show your sub directories well they'll see have some indication as you go through but it's just going to show file names really.
And then it'll have an arrow for which file if newer files in directory a does in directory B if director B doesn't have that file there's going to be an arrow going from the left from first directory to second directory.
And if the second directory has a newer version of file and there's going to be an arrow going to the right and you do have an option in there when you do only do updates in one direction.
So you can decide that you only want to do a right hand update so just or left hand update.
So only the files are newer on the left will get will get over or only new files are newer on the left will write the older files on the right or only the files that are newer on the right will write files on the left you've got that decision to make.
And there's also a merge option which I can only think will come to tears that's going to try to combine files rather than over writing one with the other.
So I don't I don't recommend you ever touch that.
And then finally there's a go option which does emerge as we would think that if the you know whatever files are newer in the right hand column will write the older files in the left hand column where files are newer in the left hand column will write the files that are older in the right hand column and that's what we wanted.
So you hit go to make that magic happen and you know in in a few minutes you'll you have identical file structure in those in those two target folders that you select well what else I can say about it I think we've covered you to send pretty well I hope it's something you might find useful.
If you know of anything the rest of us might find useful please please come to hacker public radio and recorder in episode it'll make kin so happy because he's there in the Netherlands you know right now I think we're down to 11 11 days of shows that close the weekends and he's like tearing his hair out and I don't know if he can afford to be doing that so please come up with a topic recorder show.
Drop it in here and and we'll be all be so so happy. Okay as always I've been 5150 your host or not as always it's only it's only always when when I'm doing the show because it's usually other people doing the show but as always when I'm doing the show then I've been your host 5150 for hacker public radio and just have one hack of a time until we get to talk again.
Thanks.
Hacker public radio was founded by the digital dog pound and the infonomicon computer club and it's part of the binary revolution at binwreff.com.
If you have comments on today's show please email the host directly leave a comment on the website or record a follow-up episode yourself unless otherwise status today's show is released on the creative comments, attribution, share a light 3.0 license.
Thank you.
