So if you create a backup, you better store it off-site, because if your server goes down,
your backup will be lost and you can't restore it anymore.
Now to store files off-system, Linux has a couple of utilities available.
First, there is SFTP, which uses an SSH process that is running on a remote system to upload
files using traditional FTP commands.
I can see one use case only, and that is if you have used traditional FTP very often.
But nowadays, that's not very common anymore.
You might like SCP, which is also part of the SSH package, and it can be used to copy
individual files over.
Very convenient on a file-by-file basis.
But if you really want it to be powerful, you better use rsync.
rsync is used to synchronize files over to and from remote servers, and it does an excellent
job making delta-syncs, meaning that it will synchronize differences only.
Use something like rsync-avz home-student to student-add-192.168.29.139://home-student,
and your directory will be synchronized with the remote directory.
Two options that I should talk about in the context of rsync are minus-n.
Minus-n is doing a dry-run.
It will show you what it will do without doing it.
The second option is minus-delete, and that will make sure that if a file in the source
doesn't exist, but does exist in the target, it will be deleted.
In my opinion, that's a pretty dangerous option, so better don't use it.
Let me show you.
So I'm going to start using scp-student-add-192.168.29.139://etc/.
Then let me use ls minus l hosts, and there we have the host file from the remote machine.
Now the other example is rsync.
So how are you going to use rsync to synchronize?
Well, let me use rsync-avz.
Hang on before I'm doing that.
Let me use touch-home-student-hello-file, uppercase, so that it's easy to see.
Then rsync-a for archive mode, v for verbose, z because it's cool to apply compression,
but that's not really needed if you don't synchronize very much.
Slash home slash student with a slash behind it to slash student-add-192.168.29.139://home
slash student slash.
Please do not forget the slashes.
And then it is prompting for the user student password, and it will synchronize files.
So if I would use ssh student-add-192.168.29.139 ls minus l on slash home slash student, then
we should see the result.
There we go.
The result is there.
So that is how rsync is working.