Web Hosting Talk







View Full Version : .tar


Semaj
11-28-2002, 11:04 PM
Hi,
I need to tar up a dir located in /home/domain/domain_name/www/web/Files_Here
so I can download it & upload to a new server.
But when I untar, it has all the dir's.....

How do I tar/untar so it will not have all the dir's but just the Files in my new dir on the new server?

Also, what is the correct commands to tar/untar?


thanks
James

cubision
11-29-2002, 10:33 AM
You can find all of the information needed to complete this task in the man page for tar. On most linux systems you can see this by typing:

man tar

That command gives you a virtual manual to the program tar.

sasha
11-29-2002, 10:58 AM
You can cd to the directory where your files are and then run tar there:
cd /home/domain/domain_name/www/web
tar cvzf myfiles.tar.gz *
then, if you moving files from *nix to *nix you can copy them directly
scp myfiles.tar.gz newhost.com:~/www/newweb/

to extract those files ssh to new host and
cd www/newweb
ls
you should see you archive here and then

tar xvzf myfiles.tar.gz

Semaj
11-29-2002, 12:43 PM
Hi sasha,
Thanks, it worked perfectly.......

One more thing, after I transfered the files, there are a couple unwanted dir's that I want to delete.
What are the commands to do this without going through every file.


James

sasha
11-29-2002, 12:48 PM
rm -rf dirName
This will delete named directory and all files under that directory.

Semaj
11-29-2002, 01:18 PM
One more thing,
I have 2 domains with sub-domains that I need to transfer but they didn't seem to move using the tar command.
Do I need to use a different command.
I also have a secure cert I need to transfer, do you have any suggestions?
Thanks again for the great help.
james