LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Backup (https://www.linuxquestions.org/questions/linux-software-2/backup-55001/)

vcheah 04-14-2003 10:37 AM

Backup
 
Hi..
thanks at first..
question is..

I am running a redhat 8.0
and I am thinking to install freebsd.. but i have a lot of files in my redhat that is not valueable. but it will be nice for me to keep it.
I am planning to back it up. but .... I got no idea how..
i have a 6gb harddisk and i plan to get a tape drive ..
what are the good way to get it done ?

RolledOat 04-14-2003 12:00 PM

tar, tape archive, although that is misleading, it is simply a backup file similar to zipped archives. It will create backups of files/directories and individual files can be extracted at will. Actually I was impressed with Konqueror being able to navigate a complete tar as if it simply was a directory.

the simplest way is
tar cf filename.tar <filename1> <filename2>
or
tar cf filename.tar * (wildcard)
tar cf filename.tar /path to directory/ (recursively backup from that directory down).

You can then gzip, compress, etc. It is then a single file you copy somewhere. Search google for an easily readable 'man tar' or simply search here. Tons of tar information.

RO

P.S. If the tar is too big, you can 'split' the tar file into manageable chunks then 'cat' (concatenate) back together, but I leave that as an exercise for the reader. :)

vcheah 04-14-2003 03:10 PM

as i understand..
after you do a tar.. it will compressed all the file to one..
here is the confusing scenario for me..
let say i install a new system..
if i untar the "backup tar" file... then it will overwrite those new system file isn' t?

RolledOat 04-14-2003 03:23 PM

It depends on what you tar and where you restore it. For example, I tarred up /root and /home completely into a single tarfile before I returned my computer and got my new one (leased from work). I then created a directory called /backup. I moved the tarfiles there and it restored them relative to /backup, so I had
/backup/root
/backup/home
and all files/subdirectories under that. It restores relative to where you are, not the absolute path for each file.

I hope that helps. Also, you can think of a tar as a big collection of 'deflated' files that are all in one large master file.

RO.

vcheah 04-14-2003 03:29 PM

ok.. thx..
but what about ..
backing up specific file .. and locate it back
.. is there anyway i can tar.. with the path..
so went i untar.. it .. the backup will automatically replace
example.. those config file..
they are all over.. my system..
so .. if i back it up..
and then when i need them.. i assume i can just run the backup and it run ..

RolledOat 04-14-2003 03:39 PM

For these type, create your tar from /, then when restoring, untar from /, which puts it in the absolute path for your system. For example, I want to backup /usr/bin, all files that start with cow (cowtip, cowview, etc)

cd /
tar cf cow.tar /usr/bin/cow*

Then, when I wanted them back, I copy the tar to / and untar it. If I only wanted cowtip, then, in /
tar xf cowtip.tar cowtip
and it would restore the one file. With tar, and that is where the reading comes in, can do a lot more than I outlined. Append to it, REPLACE files within the tar, extract any single file, etc. It is a must learn for Linux/Unix in my opinion.

RO

vcheah 04-14-2003 03:44 PM

Thanks..

RolledOat 04-14-2003 03:55 PM

No problem...happy trails.

RO


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