In this example, we're going to quickly walk through
how to store files into our backup system.
But first we're going to use the tar command,
which stands for the tape archive command.
So this can combine multiple files to make it efficient
for when we store files together in the backup.
Okay, before we start,
just note your backup might be locked.
So in order to unlock it,
all you would do is go to your files application,
locate that backup drive and enter your password.
And that'll make things easier for one,
you get on the command line.
Okay, so we're going to use an example of employee data
and we want to tar this up and put in our backup location,
where it's encrypted and safe.
So if we list out here,
I have this employee info folder.
And we're going to use the tar,
create verbose file.
Then we just want to indicate the file
to what we want to name it as.
Employee underscore data,
tar,
employee info.
And this exclamation point is going to say,
we're going to take every file that's in that directory
and apply it to this tar.
Okay?
Now we're going to list out our drive
just to see if that tar is present.
Okay, we see employee data dot tar was successfully created.
It's highlighted in the red, about six down.
Now, we can use the tar command as well
to list out the contents of that tar file.
So we'll use that for the employee data dot tar file,
but again, we just need a quick reference
of the information that's in tar file.
We want to use the tar dash T
and the F option to specify that tar.
Next thing we're going to do is go ahead
and put that copy into that backup drive.
Okay.
Now again, let's just verify like always
that it successfully made it to the backup drive.
Alright, we see it there at the top.
So next we're going to restore all the files
from the archive and then restore a single file.
So, let's go to that backup drive.
K.
Let's go ahead, extract this.
Let's look and see.
Now that employee info.
That's there because we just extracted it.
So now the directory is there,
as if it was a normal directory.
That's just going to list out this employee folder,
just to make sure everything's in there.
That's intended, alright?
We see we have all the three files that we had earlier.
Just go ahead and remove that really quick.
We don't really need it.
We're just using it for testing purposes.
Alright, so we're just going to go ahead and un-tar,
just one file specifically, just to test that out.
we're going to use the XF option
when it's employee
info. So we have to specify the directory
and the file that's within that archive.
Alright. So if we look at here
we see only that one file was removed.
So once we see the, into the, we list out the contents
of this employee directory,
we should only see that one.
Okay.
The last thing we're going to do
we want to learn how to sync data.
So a lot of times what's going to happen
in the organization is you want to have some information
always copy to the backup.
So the downside
of using the tar file is typically it is not efficient
at copying information from one location
to the other that needs to be constantly updated.
So what we're going to do is use the rsync
and we're going to use a live file in our home directory.
And we want to make sure anytime there's a change to any one
of the files, only that information is being sent over
to the backup drive because we don't want to have to
copy full drives over and over again,
cause that takes up network bandwidth.
And rsync is the perfect command to use with because
of its efficiency in synchronizing data.
So I have a sense of data photo listed in here
and we're going to use that as the test.
So we're going to make sure that any time that any
of the contents of sensitive data,
which we can list out really quick
are changed on the backup side.
Only what's changed.
That file is going to be sent over for the update.
Again, reducing that network bandwidth
and increasing efficiency.
First thing we need to do is do a rsync command
use archive for our verbose mode,
We going to use our sensitive data,
Do the backup data.
Okay. Send all three files.
We see how many devices sent, how many received, speed.
Again, this tool is designed for network efficiency.
Alright. So next let's add some data
to one of our software listing folders.
So I'm just going to put, let's say new data to be added.
Okay.
Going to pin this
new software listing
new one dot TXT.
I'm going to use rsync command.
You're going to see is only going to send the data that
was updated
Again AV.
Alright.
So we see it only sent the software listing one
because the other ones were not updated.
So again, it shows that it increases efficiency by lowering
the amount of traffic that is added to the network
for backups.
Alright, quick overview.
We went through how to tar up files, how to extract them
and how to sync the information typically to data backup
for a maximum efficiency using the rsync command
that concludes this walkthrough.
And I'll see you in the next lesson.