TAR Linux

I need to make a TAR of the contents of directory called "data1", but I don't have space on my main HD, therefore I want to create the file directly onto an NFS mount.

What is the correct command to TAR, preserve permissions of all files/subdirectories and also save file directly to another directory/filesystem?

And later how do I untar this backup to another location?
ssardellaAsked:
Who is Participating?
 
farzanjCommented:
tar pcvf /path/to/another/filesystem/file.tar directory 

Open in new window


To Untar

tar xvf file.tar -C /path/to/another/filesystem

Open in new window

0
 
omarfaridCommented:
try this

cd /path/to/mydir

tar cvf /path/to/mytar/dir/mybackup.tar

to restore

cd /to/myother/dir

tar xvf /path/to/mytar/dir/mybackup.tar
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.