?
Solved

TAR Linux

Posted on 2012-08-14
2
Medium Priority
?
515 Views
Last Modified: 2012-08-15
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?
0
Comment
Question by:ssardella
2 Comments
 
LVL 31

Accepted Solution

by:
farzanj earned 2000 total points
ID: 38292772
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
 
LVL 40

Expert Comment

by:omarfarid
ID: 38293014
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

Featured Post

Get quick recovery of individual SharePoint items

Free tool – Veeam Explorer for Microsoft SharePoint, enables fast, easy restores of SharePoint sites, documents, libraries and lists — all with no agents to manage and no additional licenses to buy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses
Course of the Month14 days, 21 hours left to enroll

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question