LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Correct Command, anyone? (https://www.linuxquestions.org/questions/linux-general-1/correct-command-anyone-15048/)

tomplate 02-25-2002 01:52 PM

Correct Command, anyone?
 
I need to know exact command to copy my home directory
to another partition, as a backup. The partition is hda1 and
is already formatted for Linux.
I guess I would need to backup /etc also to keep my settings.
I have no other way to make a backup, externally, so this is
the best I can come up with. Besides home and /etc , is there
anything else I might need to backup for safety's sake?
If there is a better way than Terminal to accomplish this,
feel free to post that as well.

THANKS.

(The idea here is to protect me from my own inexperience, not
against harddrive failure.)

neo77777 02-25-2002 02:08 PM

You can use cp as follows
cd /
cp -R /home /backup
but it's anormous amount of space I guess you want to back up, I'd suggest tar everything into one file and then put this file somewere safe
cd /
tar cfv backup.tar /home
tar cfv backupetc.tar /etc

then move two tar files (backup.tar and backupetc.tar) into another filesystem if you prefer to do so. Later you can untar them
just type
tar xvf backup.tar
tar xvf backupetc.tar

crabboy 02-25-2002 10:36 PM

Code:

cd /
find etc home -xdev | cpio -pvmd /backup

If you are going to use cp, I'd suggest the -a flag. It is the same as -dpR and will copy sym links correctly and preserve file dates.

tomplate 02-26-2002 08:39 PM

I don't quite understand bottom line..
 
First, let me say I had to create a partition, make it ext3,
and it is now set up, mountable, and named, say, MYLINUX.

NOW, I am not sure what is the final finished version of
the command I should use to copy a directory directly
to the partition MYLINUX. For example, not sure where the
-a flag should go. Still not clued-in to Terminal too well,
nor command syntax.

As soon as I finish this backup, I will be able to take an overdue
vacation...So would appreciate spelling this out. AND THANKS...


All times are GMT -5. The time now is 06:17 AM.