Ubuntu_16.04 [SOLVED]: tar compress with -C argument doesn't work

Ubuntu_16.04 [SOLVED]: tar compress with -C argument doesn't work

Home Forums Ubuntu 16.04 Ubuntu_16.04 [SOLVED]: tar compress with -C argument doesn't work

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #36824

    Anonymous

    QuestionQuestion

    This set of commands aren’t working as they’re supposed to:

    mkdir -p /home/git/root_backup_folder
    cd /home/git/gitlab/git-data/repositories
    tar zcvf dailybackup.tar.gz * -C /home/git/root_backup_folder
    

    It is completely ignoring the -C argument and creating the file in /home/git/gitlab/git-data/repositories. What I’m doing wrong?

    #36825

    Anonymous

    Accepted AnswerAnswer

    The -C flag doesn’t specify the output directory. You need to do this at the point at which you specify the archive file. So, your command could become:

    tar zcvf /home/git/root_backup_folder/dailybackup.tar.gz *
    

    Source: https://stackoverflow.com/questions/47980019/tar-compress-with-c-argument-doesnt-work
    Author: Nick
    Creative Commons License
    This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.