Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Slackware This Forum is for the discussion of Slackware Linux.


  Search this Thread
Old 02-16-2006, 07:47 PM   #1
LQ Newbie
Registered: Jan 2006
Location: Southern California
Distribution: Slackware 10.2
Posts: 19

Rep: Reputation: 0
How should I backup my Slack 10.2

I installed slackware 10.2 recently on my machine and I finally have it tweaked and setup just the way I want it. I was wondering what directories I should backup and what the best way to go about it is. In particular I want to make a **.tar.gz or **.tar.bz2 file that I could just unpack in the event that my system is rendered inoperable. My main thing I want to know is do I need to worry about permissions while I backup my sytem? in the tar man pages it has a switch -p that can be used. Should i d this while creating the backup, or something to be used only when I unpack it? Plus, how do I specify multiple directories to be include. I know for sure that I want the /etc file, and my home folder. Do I have to make seperate backup files for each?

Thanks for your help,
Old 02-16-2006, 08:16 PM   #2
Senior Member
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,125

Rep: Reputation: 165Reputation: 165
I use a 2 step process for backups. Step 1 is a fortnightly full backup where I boot my PC with a rescue CD and use cp -dpR to copy everything from the main partitions to a backup hard disk. Step 2 is a nightly backup that does a quick and dirty save of files from a cron job.:
# Copies (and compresses) system config files and user data files.

KEEPERS="/boot /etc /home /root /usr/local/cvsrepos /var/spool /var/lib/mysql"
ARCHIVE="`/bin/hostname`-`date '+%F'`.tar"
OPTS="-r --atime-preserve --exclude /home/backup -f"


echo "Creating tar file"
for KEEPER in $KEEPERS; do

echo "Compressing tar file"
[ -f $BACKUPDIR/$ARCHIVE ] && /bin/bzip2 -zv $BACKUPDIR/$ARCHIVE

/bin/chmod 0640 $BACKUPDIR/$ARCHIVEBZ2
/bin/chown backup:backup $BACKUPDIR/$ARCHIVEBZ2

echo "Done. Backup is in ${BACKUPDIR}/${ARCHIVEBZ2}"

# end.
There's probably a cleaner way to add files to the tar file, I just haven't looked for it. As to which locations to back up, it depends on where your applications put their configuration data, if it's all under /etc, you won't have a complicated backup set. Also, the -p switch is used when unpacking so that the extracted files keep their permissions.
Old 02-16-2006, 09:35 PM   #3
Registered: Nov 2004
Location: Columbus, Ohio
Distribution: Slackware-Current / Debian
Posts: 795

Rep: Reputation: 30
A simple tar file of / has saved my ass numerous times. I make my backups on a live system overnight. I've never had a problem.
Old 02-17-2006, 10:47 AM   #4
Senior Member
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled
Whenever I do a new install, I start a log of everything significant I do as root; installations, config changes, permissions, i.e. anything that isn't regular user stuff that changes the original setup. To make things easier, I have a script in /usr/local/sbin which allows me to update the log instantly from the command line. For config files, I create a backup of new + old in a directory in /root. For installs, I put a copy of the package, install logs, and a text file with config and compile command lines. I also set up /root as a symlink to /home/root and mount /, /usr, and /boot as read-only (/ is actually remounted as read-only in rc.local.) Lastly, I keep an archive on a separate partition for backing things up that will not change; images, documents, messages, etc.

I keep most important things backed up in a mirror partition. Periodically I just cp -dpPRux the applicable paths. When I do a hard backup, I just burn a CD or DVD of /home and my archive, and /etc and /var if I feel like it. Because I always have an accurate log of the changes I make to my system, I can restore my system from scratch in as long as it takes to do a clean install plus the changes I've recorded. Believe it or not, I've installed clean about 10 times and this works perfectly. This also prevents restoring latent bugs in your installation (such as undoing a change; rather than have it done then undone, you just skip it altogether.)

The other thing is I keep /home and a few other things on an external device so I can use the same profiles on different machines. This also makes it quite a bit easier to do a clean install without destroying things.

My system is a little more complex than what I've said (e.g. encryption, etc.), but that's the general idea.

Last edited by ta0kira; 02-17-2006 at 10:49 AM.
Old 02-17-2006, 05:16 PM   #5
Senior Member
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Rep: Reputation: 544Reputation: 544Reputation: 544Reputation: 544Reputation: 544Reputation: 544
I think backups is one of those topics that if you ask 10 people for an opinion you'll receive 15 responses.

For myself, I use old hardware and I use removable hard drive bays. I temporarily install spare hard drives for my backups. People with more modern hardware could use USB sticks. Although some people might recommend CDs or DVDs, I always have thought that option too slow and cumbersome for my needs.

Because I use hard drives and I am not supporting any large network or additional users, I don't worry about compression. I use one spare disk for full backups and another for differential backups.

I use a separate partition on my installed hard drive to store temporary snapshots when I know I am purposely going to tinker. In that location I copy only configuration files, primarily the entire /etc and /root directories, but also unique files such as certain X11 or KDE config files.

I use two scripts that evolved slowly as my own understanding of my system and needs grew.

I use a partitioning scheme to provide another layer of protection. I maintain /boot, /home, /tmp, /var, /usr/local, /opt all on separate partitions.

FWIW, I maintain backup copies of individual files using the .bak extensions, for files such as xorg.conf, fstab, grub menu.lst, etc. That way if I hose my box I can restore those files quickly.

Lastly, I install an alternate installation of Slackware to provide me an emergency back door to get into all of my partitions should I hose my primary installation in an inaccessible manner.

Of course, some people use RAID to provide another layer of protection.

One technique for developing a backup strategy is to perform a walk-through of trying to restore files.

The bottom line is that every user needs to experiment and customize their backup strategy to taste. Don't be afraid to modify your own strategy as you move along.
Old 02-17-2006, 09:02 PM   #6
Registered: Jan 2003
Location: Hong Kong,China
Distribution: Slackware,OpenSUSE
Posts: 472

Rep: Reputation: 30
nhouseman85,I recommend you Linux Ghost-"PartImage".

I have a server which I would backup daily.I just download Knoppix Live CD,and use the partimage software inside that CD,all my server's files (around 4GB) was back up in 5 minutes.Also,if you want to restore it,just insert the CD and find the tarball file.

That's my habit to back things up,no permission problem bugs me.
Old 02-18-2006, 01:26 AM   #7
LQ Newbie
Registered: Jan 2006
Location: Southern California
Distribution: Slackware 10.2
Posts: 19

Original Poster
Rep: Reputation: 0
Thanks for all of your suggestions! They have definitely shed some light on how diversely things can be down. I hope this thread helps other new slackers like myself.



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
Slack 10.2 slack 10.2 ran xserver after all on sata with via board devafree Member Success Stories 5 05-30-2006 11:54 PM
can I backup a root disk and boot from the new backup disk linuxbkp Linux - Enterprise 3 10-15-2004 06:42 PM
backup files over network on Slack 9 ne21 Slackware 2 04-09-2004 12:21 AM
Selective backup to CDRW, or other backup methods. trekk Linux - Software 1 11-03-2003 02:46 PM
backup and update the backup file doris Linux - General 4 08-24-2002 07:26 PM > Forums > Linux Forums > Linux - Distributions > Slackware

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

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