- Another awesome backup utility is rsync.
What is so awesome about rsync?
You can use it to synchronize files
between different directories.
You can also use it locally,
uh but really the power is uh
in synchronizing between remote systems.
The only requirement is that remote,
if needs to have sshd running.
Rsync is using the sshd connection.
It's a great utility to ensure that the contents
of a directory, is synchronized with the contents
of a remote directory.
Let me show you how to use it.
Before I begin this demo, uh you must realize
that this demo requires two computers.
Alright, so let's start this demo.
I'm using mkdir files
and then touch
files/file.
1 up to
100.
Curly brackets.
Yeah,
and then I can use rsync
minus azP.
A is for archive mode, z is through zip it,
and p is for progress.
To show you progress and that's convenient
And I'm going to do that for files to student
at 192, 168, 29, 169
That's the other server, slash home, slash student
slash files.
(typing)
And there we go.
As you can see, a lot of stuff has been synchronized.
Let's check on the other server,
where you can see
that the directory files has been created.
And in the directory files, we have all these files.
That's looking cool.
Now, I'm going to create a couple more files.
So touch on files.
File 101
up to 110.
And let's do something funny.
I'm also going to remove files,
file 50.
And now what is happening,
if you run the same rsync command again.
(typing)
As you can see, it is uh synchronizing file 101
up to 110, but you don't see the removal.
And that is because,
rsync by default, is not removing anything
unless you specifically tell it to.
You know uh,
removing things automatically may lead
to disaster, so you need to specify the
'minus minus delete' option,
if you want to delete as well.
And there we can see, deleting file 50.
This is basically, our rsync is working.
Pretty simple, pretty straight, pretty efficient.