Slackware This Forum is for the discussion of Slackware Linux.
|
Notices |
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
02-16-2006, 07:47 PM
|
#1
|
LQ Newbie
Registered: Jan 2006
Location: Southern California
Distribution: Slackware 10.2
Posts: 19
Rep:
|
How should I backup my Slack 10.2
Hello,
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,
Nick
|
|
|
02-16-2006, 08:16 PM
|
#2
|
Senior Member
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141
Rep: 
|
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.:
Code:
#!/bin/bash
#
# Copies (and compresses) system config files and user data files.
#
BACKUPDIR="/home/backup"
TMPDIR="/tmp"
KEEPERS="/boot /etc /home /root /usr/local/cvsrepos /var/spool /var/lib/mysql"
ARCHIVE="`/bin/hostname`-`date '+%F'`.tar"
ARCHIVEBZ2=${ARCHIVE}.bz2
OPTS="-r --atime-preserve --exclude /home/backup -f"
FSROOT="/"
[ -f $BACKUPDIR/$ARCHIVE ] && /bin/rm -f $BACKUPDIR/$ARCHIVE
[ -f $BACKUPDIR/$ARCHIVEBZ2 ] && /bin/rm -f $BACKUPDIR/$ARCHIVEBZ2
echo "Creating tar file"
for KEEPER in $KEEPERS; do
/bin/tar $OPTS $BACKUPDIR/$ARCHIVE -C $FSROOT $KEEPER
done
echo "Compressing tar file"
[ -f $BACKUPDIR/$ARCHIVE ] && /bin/bzip2 -zv $BACKUPDIR/$ARCHIVE
/bin/chmod 0640 $BACKUPDIR/$ARCHIVEBZ2
/bin/chown backup:backup $BACKUPDIR/$ARCHIVEBZ2
echo
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.
|
|
|
02-16-2006, 09:35 PM
|
#3
|
Member
Registered: Nov 2004
Location: Columbus, Ohio
Distribution: Slackware-Current / Debian
Posts: 795
Rep:
|
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.
|
|
|
02-17-2006, 10:47 AM
|
#4
|
Senior Member
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078
Rep: 
|
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.
ta0kira
Last edited by ta0kira; 02-17-2006 at 10:49 AM.
|
|
|
02-17-2006, 05:16 PM
|
#5
|
Senior Member
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482
|
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.
|
|
|
02-17-2006, 09:02 PM
|
#6
|
Member
Registered: Jan 2003
Location: Hong Kong,China
Distribution: Slackware,OpenSUSE
Posts: 472
Rep:
|
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.
|
|
|
02-18-2006, 01:26 AM
|
#7
|
LQ Newbie
Registered: Jan 2006
Location: Southern California
Distribution: Slackware 10.2
Posts: 19
Original Poster
Rep:
|
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.
Thanks,
Nick
|
|
|
All times are GMT -5. The time now is 06:42 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|