Hey guys and welcome back. So in the previous nugget we discussed the general concept around
backups, we also discussed the type of directories that we may or may not want to target for
our backups and now what I want to do is to continue further down this path of discussing
backup strategies. So what I first want to talk about are the different types of backups that we
can actually do. Now the very first type that we can do is something called a full backup. This name
is rather self-explanatory. Simply put when we conduct a full backup of our data what it's going
to do it's going to copy the entire data set. So absolutely everything that you have specified
should be backed up will be backed up. So the advantages of this is that it's going to be the
most robust in terms of backing up your data i.e it's going to provide the best protection for
your data because absolutely everything is going to be copied but the reality is this is not always
used. So the question may be why would you not want to invoke this type of backup? Well simply put
because when you conduct a full backup this is ultimately going to take up a lot of storage.
Think about it if you're copying all the data all the time that data has to be stored somewhere
and the more data you're copying the more storage you are going to need and it is for this reason
that most organizations will not rely on a full backup as their sole means of a backup strategy.
And by the way it is not just the storage space that is a problem when dealing with a full backup
you can imagine that the more data you have to copy the more time consuming that is therefore the
process indeed does take a lot longer. So if you happen to be an organization who prioritizes time
and efficiency and you don't necessarily have unlimited storage you're not exactly someone
like say google you may instead rely on something called incremental backups. Now incremental backups
were kind of designed to ultimately reduce the time it took to perform a backup as well as reduce
the amount of storage needed to perform the backup. So that sounds like a big win we're getting
our data backed up quicker and using less disk space. How on earth is this actually implemented
well the reality is when we are talking about an incremental backup what we're doing is we are
backing up data that has changed since the last backup. So think about this imagine that you have
regular backups so really what you're going to do is a combination of a full backup as well as
an incremental backup. So let's imagine let's say on the very first day of the week that would be
maybe say in Monday. On a Monday the organization decides to do a full backup that means like we
say absolutely everything is going to be copied and carried over onto some type of storage maybe
say an external server. So a full backup is done however we don't want to repeat that process on
a Tuesday because again it's going to take a long time and it's going to take up a lot of storage.
So instead on Tuesday we could just do an incremental backup. Similarly you could do the
same thing on Wednesday an incremental backup and the reality is you could do the same on Thursday
and Friday. So think about it all we are doing is on the very first day we're copying all the data
and on the next day if the data has not changed from the day before we don't actually have to
copy anything there is no backup necessary because the data is the exact same as when we back to tub
on Monday. However let's say on day three we happen to add file 1.txt just one additional file obviously
this is not the most realistic example but just play along. So indeed with respect to this backup
here the only thing that we have to copy is this file because this file is the only thing that has
changed from when the last full backup was performed. Now this is actually more efficient with respect
to backing up data because like I say we just have to back up those changes and if those changes
are very minimal and that is going to be a very speedy process. The difference here though is that
this can actually take a long time to restore our data because think about it what if you wanted to
restore data from Wednesday. Well you couldn't just restore Wednesday on its own because that would
only contain the differences that were implemented on Wednesday say for example that file 1.txt that
is clearly not a full backup instead we would have to restore whatever it is on Wednesday and then
we would have to restore whatever it was on Tuesday and then we would have to restore the full backup
on Monday. So really we have to do multiple restores from multiple different points and build
that data up gradually depending when it is you actually want to restore from. Also if you happen
to have some type of damaged media say for example the disk that you're copying to is damaged you may
only have some type of incomplete data recovery i.e. you do not get to restore all of the data.
Now like I say we have the full backup we have the incremental backup and we also have one called a
differential backup. So what exactly is a differential backup? Well a differential backup is
really quite similar to an incremental backup. The main difference here is that when you use the
incremental backup method as we just saw what we are actually copying is only the data that has
changed since the last backup. So think about it to go back to our analogy on Monday we do our full
backup on Tuesday let's say we add file 1.txt so when we do our backup this is the only file we
have to backup then on Wednesday we add file 2.txt so all we have to do now is to copy and backup
file 2 because that is the only difference between the last backup i.e what happened on Tuesday.
Now with respect to our differential backup strategy the difference here is that every
single backup we're doing with a differential backup is going to contain all of the data that
was changed since the last full backup big difference. So think about this again we do our
strategy on Monday we do our full backup on Tuesday let's just add file 1.txt so on this day here
all we're going to do just like with our incremental backup we're only going to backup the changes
from the last full backup which in this case here is file 1 nothing is changed here. However
if we go to day 3 on Wednesday and we add in file 2.txt the differential backup is not just going
to copy file 2 it's going to make a copy of file 2 yes but it's also going to make a copy of file 1
because these are still changes that have been implemented since the last full backup so in
day 3 here we're actually going to back up file 1 once again which was already copied yesterday
as well as file 2 so a little bit different indeed so the advantage here is that we're going to have
a shorter restore time because all we have to do is we pick a day that we want to restore from and
that's going to have all of the changes from the last backup in one location and then we combine
that with the last full backup. Now you might be thinking well a differential backup sounds like it's
much better solution than an incremental backup why on earth would you ever want to choose an
incremental backup well the reality is a differential backup even though it gives us
similar properties but it does allow us to restore quicker the reality is the differential backup uses
more storage so if you happen to be low on storage maybe still despite the longer restore time the
incremental backup would be a better solution for you whereas if you have a little bit more
storage to spare then indeed the differential backup strategy might be the best way to go and of
course if you happen to have a ton of available storage and a lot of free time then indeed you
could just back up absolutely everything with a full backup every single day but again this begs
question do we have to back up every day is that just a given that we have to implement this well
the answer to that is no of course what we want to do is we want to use our judgment so maybe it
makes more sense for your company to back up maybe twice a week or once a week really this is going
to come down to you understanding what it is you want to back up i.e what file systems and think
about how often that data actually changes and not just how often it changes how much it changes
if we happen to have a lot of changes that would be hard to restore and recreate if we lost that
data then it makes sense to implement more frequent backups to protect you from that event of a
catastrophic data loss however if your data is relatively unchanging and even if it does change
it only changes by a small amount well that may tell you that maybe you can relax a little bit
and back up a little less frequently but the reality is is that you maybe have to introduce
a combination of backup strategies maybe for some data you want to be doing maybe say a full backup
regularly because it's super valuable it's always changing you cannot afford to lose it but there
maybe are other disks on your systems other partitions whatever it may be other file systems
maybe you want to back up that data a little less frequently and again there is no absolute perfect
golden rule here this is again one of the cases whereby we want to understand the variables that
play here and use our best judgment to inform our decision now one final component we want to talk
about is where exactly should we store this data does it just go to the cloud and disappear into
the sky well to be honest there are different solutions that we can use and we have seen
different solutions historically and we have to understand what those different solutions are so
one of the original solutions the og would be magnetic tape okay now one of the advantages
of using magnetic tape is that this would be fairly cheap to use so it's quite cost effective in that
sense similarly you also get some fairly good storage capacity with this media it's cheap you
get a lot of it you can store a lot of data you can also introduce fairly good security on this media
and it is generally quite reliable to use now the problem here with the tape is that you have fairly
slow data access so it's not exactly going to be like an ssd whereby you can get quick reading
rights and quite honestly when you're using magnetic tape it does require a lot of maintenance
just by the physical nature of the media itself so as an aside with respect to magnetic tape we
know we have the command tar this is where the name of this utility actually comes from it comes
from a tape archive so this was the media in mind when this utility was first developed now as an
aside we also have out with the tar command we also have a command called mt let me show you what
this is and we can see here this command is going to allow us to control magnetic tape drive operation
so if you happen to be working with magnetic tape this is the linux based tool that you would want
to use in order to control this media okay so we have magnetic tape here the next one we can talk
about is optical storage this would be something like say a cd rom the advantage of the optical media
is that it's fairly fast it's not the fastest of course not like ssd but it still gives you
fairly good speed it's also fairly cheap to buy so once again this is going to be a winner with
respect to enterprises that don't want to spend a lot of money on storage it's also easy to obtain
pretty much you can get optical media from almost anywhere it's readily available and by the way
the physical size of the media itself i.e the discs don't take up too much room so you can
actually store a lot of data on these physical discs and not have these physical discs taken up a
massive amount of space within your physical location say for example your office or whatever
it may be now the problem with optical media is that it doesn't have very great storage capacity
so whilst it doesn't actually take up much room physically it also doesn't allow you to save
that much data relative to other storage media also it's got rather fairly low durability if you
remember the days of cds or you use dvds you may remember that you can easily scratch these discs
and if you scratch these discs the disc starts to begin to skip because the media on that disc
has now become corrupted and it cannot be correctly read this is the same problem here
whilst storing your system data on such a media if you happen to maybe leave the disc out and it
gets scratched or whatever it may be the data can quite easily become corrupted and inaccessible
certainly something to consider also with respect to your optical media one of the things it may
actually implement is that it can only be written to once i.e you're not just going to be able to
easily reuse and overwrite data on this media which means instead you would have to go out and buy
more blank discs also with respect to our optical drive it still is not quite the fastest as well so
i would still say the speed is something that is left to be desired next of course we have the
physical hard disk the advantage is here is that the hard disk is relatively fast we can read and
write data fairly quickly from this media it is also very widely available it's not hard to get your
hands on physical hard drives and of course hard drives especially nowadays can actually offer you
fairly good storage limits so you can store a lot of data on this media the problem may be with a
hard disk depending on the type of hard disk is that you may have a rather sizable hard disk so
it's not the most portable to take about with you it's not like say for example a usb thumb drive
and hard drives can also sometimes lack durability i.e if you're not careful the data itself can
easily become corrupted which is of course a big disaster scenario when this contains your backup
data now of course the other option we could have is some type of cloud storage the advantage of the
cloud storage would be that the availability is excellent assuming you have some type of internet
connection you could be on vacation in paris and be able to get a wi-fi access and download your
data remotely the data in the cloud is also very typically very well secured because you are relying
on a lot of these massive corporations which have very strong legal requirements to sufficiently
protect your data so they have all the incentives to pay good engineers to ensure good security is
in place of course that is not always a given but generally speaking good security is a feature of
the cloud but of course the problem with the cloud is that depending on how much you use the running
costs of storing this data could potentially add up and become costly so really all of these different
factors and the type of backup strategy we want to implement a full backup a differential backup
or an incremental backup as well as the actual media that we want to backup to say for example
a magnetic tape or in more modern terms the clouds all of these things have to be measured up and
tailored to suit your own needs and like so often there is no absolute golden rule the best thing
you can do is to understand the pros and the cons and use your best judgments now there are some
additional tools that we have to know for the purposes of the LPIC 2 examination that we can
use directly on our Linux systems so what exactly are those tools well that's what we're talking about
in the very next nuggets I hope this has been informative for you and I'd like to thank you for viewing