LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Is this rsync command appropriate for full system Slackware backup? (https://www.linuxquestions.org/questions/slackware-14/is-this-rsync-command-appropriate-for-full-system-slackware-backup-4175485647/)

Miranden 11-23-2013 12:19 PM

Is this rsync command appropriate for full system Slackware backup?
 
I want to make a full backup of my entire filesystem tree as described in the Arch wiki here:

This is the command they give for making the backup, excluding certain directories for various reasons that may or may not be specific to Arch:

Code:

# rsync -aAXv /* /path/to/backup/folder --exclude={/dev/*,/proc/*,/sys/*,/tmp/*,/run/*,/mnt/*,/media/*,/lost+found}
The reasons these folders were excluded are over my level of knowledge, so I am unsure if it would be the same on Slackware.

Will this command make a good full system backup on Slackware? Is there anything else I would have to do to restore it, other than copying it back to the drive and updating the fstab?

Thanks in advance.

jailbait 11-23-2013 12:45 PM

"The reasons these folders were excluded are over my level of knowledge, so I am unsure if it would be the same on Slackware."

Some of the excluded files are actually pointers into entry points in the kernel. The kernel sets them up on each boot so you don't need to back them up. Also if you try to copy a file which is actually a kernel entry point then the copy program will be denied permission to copy the file.

The files in /dev are created by the kernel at boot by querying what hardware is present and creating device files for each piece of hardware. Backing up /dev is a waste of time.

Whether you back up /mnt/* and /media/* is very dependent on how you have your file systems configured. Some people should do it, others shouldn't.

lost+found contains file fragments placed there when fsck looks at a broken partition and finds file fragments that fsck does not know where they belong. I back up lost+found and I don't know why anyone would want to exclude lost+found in a backup. If you are recovering from a disaster some of your data may only be found in lost+found.

/tmp contains files that by definition are temporary and non essential. Backing them up is a waste of time.

You only have to update fstab if you have restored files to a different partition than they originally occupied. If you have to change fstab you also may have to reconfigure grub or whatever bootloader you use.

---------------------
Steve Stites

Didier Spaier 11-23-2013 01:05 PM

Quote:

Originally Posted by Miranden (Post 5069465)
This is the command they give [...]

Rules of thumb:
  1. Never apply blindly a command, whoever gives it
  2. Never run a command without full knowledge of what it is supposed to do
HTH some.

Miranden 11-23-2013 01:26 PM

Jailbait - Thank you! That is very valuable information. I think I know what I'm doing now.

Didier - Thank you also. I know what rsync and the flags do, I just didn't know what folders I should or should not include. Basically, although I understand the command, I have only shallow knowledge of the Slackware system. Since I expect the deepening of that knowledge to be a gradual process that occurs over time, I wanted to ask the experts here to make sure I didn't leave out something I needed or include something I didn't need. Beyond knowing not to back up the directory I have my external drive mounted to, I'm pretty much in over my head in that respect. :)

Didier Spaier 11-23-2013 02:19 PM

Well, I didn't meant to minimize your knowledge (mine is pretty limited :-), my statements were rather intended for newbies who could happen to read this thread ;)

To be more constructive, I add -H to save some space in case of hard links. I took this habit as I maintain local mirrors of both 32 and 64 bit versions of the same Slackware edition and there are quite a bit of hard links in mirrors (e.g. from 32 to 64 bit versions when the file is actually identical in both) to save space and bandwidth. Of course that is probably less relevant for a backup of your own system but that doesn't hurt, me think.

Miranden 11-23-2013 03:26 PM

Quote:

Originally Posted by Didier Spaier (Post 5069501)
Well, I didn't meant to minimize your knowledge (mine is pretty limited :-)

Ha! I hope one day my knowledge has the limits of yours. Don't worry, you didn't offend me, as it is impossible to minimize what isn't there. :) I know I know nothing, but I am trying to learn.

I will do that with the -H option. Going to start now. Thanks!

Habitual 11-24-2013 09:15 AM

Quote:

Originally Posted by Miranden (Post 5069465)
I want to make a full backup of my entire filesystem tree as described in the Arch wiki here:

This is the command they give for making the backup, excluding certain directories for various reasons that may or may not be specific to Arch:

Code:

# rsync -aAXv /* /path/to/backup/folder --exclude={/dev/*,/proc/*,/sys/*,/tmp/*,/run/*,/mnt/*,/media/*,/lost+found}
The reasons these folders were excluded are over my level of knowledge, so I am unsure if it would be the same on Slackware.

Will this command make a good full system backup on Slackware? Is there anything else I would have to do to restore it, other than copying it back to the drive and updating the fstab?

Thanks in advance.

Code:

-n, --dry-run              perform a trial run with no changes made
Check it out. :)

TobiSGD 11-24-2013 10:41 AM

Quote:

Originally Posted by jailbait (Post 5069475)
lost+found contains file fragments placed there when fsck looks at a broken partition and finds file fragments that fsck does not know where they belong. I back up lost+found and I don't know why anyone would want to exclude lost+found in a backup. If you are recovering from a disaster some of your data may only be found in lost+found.

If you recover from a disaster it is too late to make a backup, recovering from a disaster should be done with restoring the backup, not taking one. If you create a new backup you should do it from a known good system, which by definition means that you have a consistent filesystem with all parts where they belong to. On such a system lost+found will be empty anyways.

Miranden 11-24-2013 12:44 PM

Quote:

Originally Posted by Habitual (Post 5069826)
Code:

-n, --dry-run              perform a trial run with no changes made
Check it out. :)

Thanks. Can you tell me what practical information that gives me? What I needed to know was which folders I should or shouldn't include to have a working backup. It seemed to me that was an issue of understanding how Slackware works, not whether the rsync program was capable of copying things. Am I missing something?

carlitoco 11-24-2013 12:50 PM

Quote:

Originally Posted by Didier Spaier (Post 5069481)
Rules of thumb:
  1. Never apply blindly a command, whoever gives it
  2. Never run a command without full knowledge of what it is supposed to do
HTH some.

Big rule! It's like "The first rule of the fight club..."


All times are GMT -5. The time now is 11:16 AM.