TAR Linux

Posted on 2012-08-14
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?
Question by:ssardella
    LVL 31

    Accepted Solution

    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

    LVL 40

    Expert Comment

    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

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Join & Write a Comment

    Network Interface Card (NIC) bonding, also known as link aggregation, NIC teaming and trunking, is an important concept to understand and implement in any environment where high availability is of concern. Using this feature, a server administrator …
    SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
    Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
    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.

    729 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

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now