Hey guys and welcome back. So what I want to talk to you about in this skill right here
is all around the concepts of backups. Now when we happen to discuss the idea of raids
in a previous skill we understood we could actually survive some type of failure within the system.
This is what the redundancy actually gave us but here is the deal. Raid is not a substitute for a
good backup solution. Indeed if you happen to have a raid array within your office maybe one of the
physical disk breaks and you are okay because the raid array can actually rebuild that data. However
what would happen if your actual whole entire office went on fire then that raid array within
that single location would be destroyed and all of your data would be gone. Instead we want to be
able to have the ability to do some robust backing up. So this is really very very important in fact
I would say it is critical to ensure your data has this backup otherwise it could be lost forever.
This could perhaps be customer data it could be valuable data just to keep your system up and
running a million reasons why you want to have this data backed up. So what I want to do to
introduce this skill is to go through some of the basics around backing up before we actually walk
through the different tools that we can use to do such a thing. So the question would be is what
exactly should you back up because think about it does it make sense to back up absolutely everything
all the time. The reality is this is unlikely to be the case instead you would very likely want to be
selective about what it is you're backing up that means that you only want to back up things which
are important to you that way you are not just needlessly using update of storage instead everything
you back up has value in of itself. So let's discuss some of the directories that we should
actually think about when we're talking about our backups. Now one of the first directories that you
should consider backing up is the home directory. The reason being is that very often given that
this is your home directory this is going to contain many many files which are valuable to you as the
user. Now of course if you only have frivolous information within your home directory you could
in fact skip this directory but the reality is is that this is unlikely to be the case you're
very very more likely indeed to have valuable information stored within this directory so
certainly the home directory should be a candidate for consideration when backing up. Now the next
directory is the user directory now this can be a little bit of a contentious one some people
feel that it is not worth backing up the user directory whereby others absolutely swear by it.
Now the reason why some people would prefer not to actually back up this particular directory
is that the contents of this directory are not likely to change instead this is going to be
stuff that you get from your package manager so if you happen to be on debian and you install
software we're using the apt program or the apt package manager should I say. The argument is
is that it's not so difficult on a new system to simply use that package manager again to pull
those same files that would populate within the user directory so there's not much changes going on
here it's not so difficult to get a working replica of this directory if you so need it so long as you
just remember what it is you have installed on what you need now this last part here is exactly why you
may consider actually backing up this directory because even though you could use something like
say the apt package manager or say for example yum if you're on retat what if you can't remember
all of the software that you had on your system sure if you keep a detailed list of everything
that you have actually installed you could use these package managers to repopulate this user
directory but if you spend the time just to back up this directory then you don't have to worry about
such a thing you just copy it over and everything will be there again now the next directory would be
the etsy directory now this directory has system-wide configuration files and because of this nature
this directory is frequently updated and is changing therefore it does make sense to take a nice
snapshot of this directory in a current working state and include it in your backups as opposed
to again trying to recreate this directory after the fact so like i say whether you're installing
new software or you happen to be making changes to your user account or your group accounts all of
this basic day-to-day administration can alter this file and when something is altered regularly
this can be a signal for you that it is something that you should be considering backing up now the
next one i want to talk to you about is the boot directory now within this directory this is where
you're going to find the kernel now if you happen to be planning to maybe install a new kernel then
is a good idea to ultimately back up this kernel i.e it is a good idea to make a copy of this directory
right here the boot directory where the kernel will actually live that means if you happen to have
some type of error you can quickly roll back and get everything working once again next we have the
bin directory where we keep our binaries now this is one of the decisions that you should actually tie
to the user directory if you choose to back up user then it does make sense to also back up the
bin directory simply puts what you happen to be backing up from the user directory will often rely
on the data that you have within your bin directory so you would like to have some type of parity between
the two if you back up one make sense to back up the other exact same logic with respect to the
sbin directory if we're backing up user the same logic does apply some of the system software that
has been installed in this directory is going to rely on information found in the sbin directory so
don't give yourself unnecessary headaches by backing up this and not having the required files you
need from here if you back up one good idea to back up the other just like with the bin directory
next we have the opt directory we know the opt directory is going to store our add on application
information so realistically if you happen to rely upon a lot of third party software then the
information within the opt directory will be valuable to you thus it would make sense to indeed
back up this directory the reality is though very often people do not choose to back up this
directory again there is no absolute right or wrong answer here this is something where you
have to use your own judgment now we know the var directory is going to have a lot of changes
within it ie this would be something that is difficult to recreate after the fact if we happen
to lose this data say for example we maybe have the var backups directory if we're on a debian
system this is going to contain at package status backups and additional system files
similarly within the var directory we could have our var lib folder this is going to contain
variable information about the state of our applications and our system also we're going to
have var log this is going to contain system and application logging information so again this
could be something that you happen to find very very valuable you want to keep as well as we could
have var mail this would contain all of the local user mail on the system so this is something you
would want to retain again this would be within the var directory and we would also have var
www if you happen to be say for example running a web server the web content from that server you
could find within here so again within the var directory this is something to consider so it
may seem like a home run a var directory is something we absolutely would always want to back
up but this really again is not the case i would say in my opinion it is very likely you would want
to back up this particular directory or perhaps some of the particular subdirectories within the
var directory but again it really does depend on your assessment of the importance of what is within
this particular directory maybe you happen to not be caring about the log file so much
because maybe you're installing a generic desktop computer however if you happen to be on say for
example a server within the system whereby you have tons and tons and tons of logs which are
very very important well it does make sense that that var directory would be included within your
backup strategy now we also have the lib directory this is again something to consider if you happen
to back up that user directory simply put because the operating system libraries will be installed
within this structure in fact it may also actually be within lib 64 depending on the system now these
are some of the locations we should think about with respect to our backups what abouts particular
directories or file systems that you should not back up well again there is never an absolute hard
rule here but this is a general guideline but really information that is not stored on your
actual hard disk such as maybe say a removable usb stick this is not necessarily something you would
have to back up on your local system similarly information that contains temporary data think
about it why would you want to back up data which by design is supposed to be temporary so certain
locations such as the dev directory or the media directory or the mount directory these are directories
and file systems that typically do not need to be backed up also we know we have the proc directory
and the sys directory which are virtual file systems which ultimately are generated within memory
this is transient data relating to things like currently running processes on our system again
this is not information you would want to back up the only time you would actually want to back up
this type of data would be if you wanted to perform some type of forensic investigation into what was
happening on a device at a particular time again this is a very specialized use case and not typical
within a enterprise backup strategy similarly within the var directory we definitely have some
data we would want to back up but actually we probably wouldn't want to back up the var temp
folder because again the data here is specifically designed to be temporary it's not going to have
any value to us in the long term so these are just some of the things that we have to consider with
respect to the location of what it is we should back up but we still have more information to
look at before we go about implementing our backup strategy so what other factors do we have to
consider 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