Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
So, I'm looking to do a simple one time backup, or at least occasional backup of my home server. It's nothing dynamic, so I just need to backup the configurations really, but I'd still like to have a snapshot of the whole filesystem just in case. The issue now is that I don't know how to do that without backing up the drives connected under "/NAS". I want to backup my system snapshot to "/NAS/data" but not including "/NAS/data" or any other child directories of "/NAS".
How would I go about doing that in the simplest way?
There's little to be gained from backing up the whole file system. If this machine crashes and must be recreated, reinstalling the OS is simpler than trying to restore from backup. What you need are the configuration and data files.
I would recommend backing up the contents of /etc (where system-wide configuration files are located) and of your /home/[username] directory, including the hidden files and directories (the ones preceded by a dot, as in ~/.libreoffice; this latter will capture all your data files. Those hidden files and folders contain your personal configuration settings.
In addition, if you have personal files elsewhere (for example, I have a working clone of my website in /opt/lampp/htdocs), you should of course grab them also . . . .
Strictly speaking, regarding the configuration settings, you really need only to back up the ones you have modified. For example, I always back up my /etc/samba/smb.conf (samba settings) file, because I have tweaked it over the years so it works for me, and I'd hate to have to recreate it. The same goes for my ~/.fluxbox directory, where my Fluxbox configuration resides. I don't back up configuration files that I have left at default values.
The argument on what to backup (/var? /tmp? funny apps which put data to /opt and /usr?) could go forever. Disks are big and cheap – just backup everything and be done with it.
Basic setup will definitely take less than 30 minutes in both directions (backup and restore).
have you ever tried backing up 8TB of data onto a single disk backup? most consumer grade NAS devices are not even that large.
Stick with backing up the basics. /home /etc /var maybe /usr/bin if you have customer scripts in there, but then better off just grabbing the specific scripts you want/need via your exclude.txt file and the make a copy of the specific scripts into your /home/user directory.
yes storage is cheap, at times, and disks are larger then they have been in the past. still there is little reason to backup / or many of the other directories out there.
in fact i might even argue that grabbing all of /etc and /var are not required either.
if you have a hardware failure and need to be up and running as long as it was not the HDDs that died, taking them and putting them into a new computer will not hurt anything. Linux =! MS in this regard and the OS will just keep on working. The kernel will/might need some new modules loaded and maybe some 3rd party drivers depending on the hardware change, but thats nothing compared with the BSOD from a MS hardware change.
if you are worried about the HDDs going down, then really all you need is your data and custom scripts. you will be performing a full fresh install of the latest greatest of your distro of choice anyways if you lose your HDDs. that is unless under contract for support for say RHEL, Ubuntu LTS, SuSe, etc... and even then you will be better off with a fresh install onto fresh hardware to reduce bloat in the kernel.
a simple rsync script with -aviS and maybe adding in a z flag if you want compression over the network with an excludes.txt and some part of the script that copies any custom scripts you have floating around the system to your /home along with your network settings, hosts, allow/deny. or other such files you might have edited like IPTables. this is all doable in roughly 150-200 lines of code of much less all depending on how customized your system is.
rsync, which should be included with your distro, is a command line tool favored for many for backups to drives (as opposed to optical media). Unfortunately, the man page and many of the online references for how to use it are pretty impenetrable.
I'm not running an X server on the machine, it's all CLI. I think I'll be fine with just the configuration files, so I'd grab /etc and /var, that should cover everything I need, maybe /opt has some stuff in it, I haven't actually checked. But I'm worried the disk might die on me eventually and it's actually only an IDE disk, so it's super slow. That being said, I run a lot off of it. I have a website, VPN, media/file services, and Plex (if anyone doesn't know what it is, it's amazing, look it up) and a couple other things. I'd like to be able to extract the files and have them all go back to where they came from, regardless of my working directory and so on. I can't remember how to do that, but we went over it in class. I just need the easiest way to accomplish it. Nothing fancy, it doesn't have to be automated and scheduled. Everything is working as is, so a configuration snapshot would get me back there if necessary.