Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This 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!


Search this Thread
Old 03-06-2011, 12:55 PM   #1
Registered: Nov 2004
Location: SW Missouri, USA
Distribution: Debian 6 "Squeeze"
Posts: 55

Rep: Reputation: 7
Lightbulb ALWAYS backup /etc and /boot before making changes!

Here is a fast note from the pain of experience. Aimed at new users:

/etc is where your gnu/linux stores it's configuration. Its function is similar to the Windoze registry. As you install, uninstall, and work with various programs, /etc changes. Sometimes, things change that make your system act unexpectedly.

A fairly easy way to backup, is to use a script. Don't panic, it's not difficult.

----- ----- -----

1) open a console
2) su
enter root password
3) # mkdir /var/backup
4) # vim /usr/sbin/prep4change
replace "vim" with text editor of your choice
5) cut and paste the following short script
Filename=/var/backup/$(date +%Y-%b-%d_%H:%M).bz2
echo "What is about to happen?"
read Note
echo $Filename."~".$Note >> /var/backup/notes
tar -cjf $Filename /etc/ /boot/
6) save the file, and exit your editor
7) chmod 755 /usr/sbin/prep4change
this makes the script "executable"

----- ----- -----

All done!
Next time you are about to install, remove, or change something, just issue prep4change as root.

If the unthinkable ( but expected ) should happen, and things stop working correctly, you have your /etc and /boot already backed up.

Your backup will be located in /var/backup
You can also $ tail /var/backup/notes to see why you made what backup

Again, this isn't the most elegant, but it's simple, and it works! From my experience, the more bells and whistles something has, the more can go wrong!
Old 03-07-2011, 02:44 PM   #2
Registered: Aug 2009
Location: /Universe/Earth/India/Pune
Distribution: Slackware64 14.1/Current, CentOS 6.5/7.0
Posts: 796

Rep: Reputation: Disabled
Good you learned that, though hard way.


backup, howto

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
Making a dd Safety Backup bill45 Linux - Newbie 8 11-28-2007 01:52 AM
making a backup script keef12345 Linux - Newbie 1 11-03-2007 06:23 PM
Making a Backup Boot disc Redfiveuk Linux - Newbie 6 05-11-2004 06:46 AM
Making a simpel backup CloudBuilder Linux - Newbie 4 10-30-2003 01:13 PM
making backup image of dual boot RH8/w2k - How? wright_pm Linux - General 1 04-25-2003 11:02 PM

All times are GMT -5. The time now is 10:39 PM.

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 @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration