LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 11-23-2013, 12:19 PM   #1
Miranden
Member
 
Registered: May 2012
Posts: 188

Rep: Reputation: 19
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.

Last edited by Miranden; 11-23-2013 at 12:23 PM. Reason: typo
 
Old 11-23-2013, 12:45 PM   #2
jailbait
Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Debian Wheezy, Debian Jessie
Posts: 7,536

Rep: Reputation: 178Reputation: 178
"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

Last edited by jailbait; 11-23-2013 at 01:02 PM.
 
2 members found this post helpful.
Old 11-23-2013, 01:05 PM   #3
Didier Spaier
Senior Member
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slackware{,64}-{14.1,current} on a Lenovo Thinkpad T61 6457-4XG
Posts: 4,295

Rep: Reputation: 1063Reputation: 1063Reputation: 1063Reputation: 1063Reputation: 1063Reputation: 1063Reputation: 1063Reputation: 1063
Quote:
Originally Posted by Miranden View Post
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.
 
2 members found this post helpful.
Old 11-23-2013, 01:26 PM   #4
Miranden
Member
 
Registered: May 2012
Posts: 188

Original Poster
Rep: Reputation: 19
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.

Last edited by Miranden; 11-23-2013 at 01:31 PM.
 
Old 11-23-2013, 02:19 PM   #5
Didier Spaier
Senior Member
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slackware{,64}-{14.1,current} on a Lenovo Thinkpad T61 6457-4XG
Posts: 4,295

Rep: Reputation: 1063Reputation: 1063Reputation: 1063Reputation: 1063Reputation: 1063Reputation: 1063Reputation: 1063Reputation: 1063
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.

Last edited by Didier Spaier; 11-23-2013 at 02:23 PM.
 
Old 11-23-2013, 03:26 PM   #6
Miranden
Member
 
Registered: May 2012
Posts: 188

Original Poster
Rep: Reputation: 19
Quote:
Originally Posted by Didier Spaier View Post
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!
 
Old 11-24-2013, 09:15 AM   #7
Habitual
Senior Member
 
Registered: Jan 2011
Distribution: Undecided
Posts: 3,424
Blog Entries: 6

Rep: Reputation: 796Reputation: 796Reputation: 796Reputation: 796Reputation: 796Reputation: 796Reputation: 796
Quote:
Originally Posted by Miranden View Post
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.
 
Old 11-24-2013, 10:41 AM   #8
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,592
Blog Entries: 2

Rep: Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047
Quote:
Originally Posted by jailbait View Post
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.
 
Old 11-24-2013, 12:44 PM   #9
Miranden
Member
 
Registered: May 2012
Posts: 188

Original Poster
Rep: Reputation: 19
Quote:
Originally Posted by Habitual View Post
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?
 
Old 11-24-2013, 12:50 PM   #10
carlitoco
Member
 
Registered: Jan 2008
Location: Berlin
Distribution: Slackware / Arch
Posts: 132

Rep: Reputation: 15
Quote:
Originally Posted by Didier Spaier View Post
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..."
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Rsync command advice for file backup terranair Linux - General 4 03-24-2011 09:31 AM
rsync backup system baronsam Linux - Software 9 05-22-2010 10:57 AM
Full system backup. Terroth Linux - Newbie 11 06-21-2005 12:52 AM
full System Backup czezz Linux - Software 10 05-08-2005 01:50 PM
full system backup dbc254 Linux - General 6 12-26-2003 09:27 PM


All times are GMT -5. The time now is 07:45 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration