tar: Exiting with failure status due to previous errors Unicorn Meta Zoo #1: Why another...

/bin/ls sorts differently than just ls

Why does the Cisco show run command not show the full version, while the show version command does?

using NDEigensystem to solve the Mathieu equation

Why isn't everyone flabbergasted about Bran's "gift"?

My admission is revoked after accepting the admission offer

Was there ever a LEGO store in Miami International Airport?

What's the difference between using dependency injection with a container and using a service locator?

Is there an efficient way for synchronising audio events real-time with LEDs using an MCU?

Why do people think Winterfell crypts is the safest place for women, children and old people?

What do you call an IPA symbol that lacks a name (e.g. ɲ)?

Putting Ant-Man on house arrest

Is it OK if I do not take the receipt in Germany?

Writing a T-SQL stored procedure to receive 4 numbers and insert them into a table

Does Prince Arnaud cause someone holding the Princess to lose?

Like totally amazing interchangeable sister outfit accessory swapping or whatever

What is /etc/mtab in Linux?

TV series episode where humans nuke aliens before decrypting their message that states they come in peace

Is it accepted to use working hours to read general interest books?

Why is arima in R one time step off?

What is the ongoing value of the Kanban board to the developers as opposed to management

Stretch a Tikz tree

false 'Security alert' from Google - every login generates mails from 'no-reply@accounts.google.com'

What does the black goddess statue do and what is it?

Why doesn't the university give past final exams' answers?



tar: Exiting with failure status due to previous errors



Unicorn Meta Zoo #1: Why another podcast?
Announcing the arrival of Valued Associate #679: Cesar ManaraUsing wildcards with tarbackup of old Mac, but tar says: Error exit delayed from previous errorsUntar error: tar: Error exit delayed from previous errorsRename directory with tarTar Archive All Files with ExtensionDrobo FS on Fedora tar backups fail w Input/output error, Child returned status 1Startx error on tty8Can I decompress a .gzip file with tar?Tar with progress but without compressiontar extract fails with status “Permission Denied” — safe to ignore?





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







68















I have written a little script that tars and compresses a list of directories + files.



The script appears to run succesfully, in that a useable .tar.gz file is created after the script runs.



However, I get this annoying message after the script finishes:




tar: Exiting with failure status due
to previous errors




I do not see any error messages whilst the script is working, and like I said, the produced file can be uncompressed with no warnings/errors. Since I am using this as part of my backup, I want to make sure that I am not ignoring something serious.



What are the possible reasons that this error/warning message is being produced - and can I safely ignore it?. If I cant ignore it, what are the steps to diagnose and resolve the error?



I am running on Ubuntu 10.0.4










share|improve this question





























    68















    I have written a little script that tars and compresses a list of directories + files.



    The script appears to run succesfully, in that a useable .tar.gz file is created after the script runs.



    However, I get this annoying message after the script finishes:




    tar: Exiting with failure status due
    to previous errors




    I do not see any error messages whilst the script is working, and like I said, the produced file can be uncompressed with no warnings/errors. Since I am using this as part of my backup, I want to make sure that I am not ignoring something serious.



    What are the possible reasons that this error/warning message is being produced - and can I safely ignore it?. If I cant ignore it, what are the steps to diagnose and resolve the error?



    I am running on Ubuntu 10.0.4










    share|improve this question

























      68












      68








      68


      15






      I have written a little script that tars and compresses a list of directories + files.



      The script appears to run succesfully, in that a useable .tar.gz file is created after the script runs.



      However, I get this annoying message after the script finishes:




      tar: Exiting with failure status due
      to previous errors




      I do not see any error messages whilst the script is working, and like I said, the produced file can be uncompressed with no warnings/errors. Since I am using this as part of my backup, I want to make sure that I am not ignoring something serious.



      What are the possible reasons that this error/warning message is being produced - and can I safely ignore it?. If I cant ignore it, what are the steps to diagnose and resolve the error?



      I am running on Ubuntu 10.0.4










      share|improve this question














      I have written a little script that tars and compresses a list of directories + files.



      The script appears to run succesfully, in that a useable .tar.gz file is created after the script runs.



      However, I get this annoying message after the script finishes:




      tar: Exiting with failure status due
      to previous errors




      I do not see any error messages whilst the script is working, and like I said, the produced file can be uncompressed with no warnings/errors. Since I am using this as part of my backup, I want to make sure that I am not ignoring something serious.



      What are the possible reasons that this error/warning message is being produced - and can I safely ignore it?. If I cant ignore it, what are the steps to diagnose and resolve the error?



      I am running on Ubuntu 10.0.4







      ubuntu bash tar gzip






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jul 29 '10 at 7:17









      morpheousmorpheous

      1,64392628




      1,64392628






















          8 Answers
          8






          active

          oldest

          votes


















          89














          You will get that message if, for any reason, tar can't add all of the specified files to the tar. One if the most common is not having read permission on one of the files. This could be a big problem since you are using this for backup. If you are using the -v flag, try leaving it off. This should reduce the output and let you see what is going on.






          share|improve this answer



















          • 8





            +1 for the suggestion (I was using the 'verbose' option previously). I found that there was a permission issue on at least one of the files. At least now I know how to resolve this. many thanks

            – morpheous
            Jul 29 '10 at 14:26













          • yes using sudo fixed the issue

            – whizcreed
            Nov 17 '15 at 12:44





















          21














          the problem is the argument,
          f argument take the next as the filename, so it must be the last of argument



          tar cvzf output.tgz folder


          or



          tar -cvzf output.tgz folder


          is the same and no take error.






          share|improve this answer


























          • Solved my problem. I was trying tar -zcvfp giving error but when tried tar -zxvpf then all fine. Thanks.

            – Mian Asbat Ahmad
            Feb 27 '18 at 10:28



















          5














          Sometimes backing up files that might change during the backup like logfiles, you might find useful the tar option '--ignore-failed-read' (I'm on Debian Linux, not sure for non gnu tar).



          Standard output and error can be redirected in 2 different files with something like:



          LOGDIR='/var/log/mylogdir' 
          LOG=${LOGDIR}/backup.log
          ERRLOG=${LOGDIR}/backup.error.log
          DATE=$(date +%Y-%m-%d)
          HOSTNAME=$(hostname)
          DATA_DIRS='/etc /home /root'

          tar --ignore-failed-read -f ${BACKUP_DIR}/${HOSTNAME}-${DATE}.tgz -cvz ${DATA_DIRS} > $LOG 2> $ERRLOG


          I find this to be generally safe, but please be careful though as tar won't stop ...






          share|improve this answer































            4














            I was having the same issue and none of the above answers worked for me. However, I found that running the following command worked:



            tar -cpzf /backups/fullbackup.tar.gz --exclude=backups --exclude=proc --exclude=tmp --exclude=mnt --exclude=sys --exclude=dev --exclude=run /



            The errors that were being referred to in tar: Exiting with failure status due to previous errors can be identified by turning off the -v option. Upon review, the errors came from directories like /run and /sys.



            By excluding these directories, it works just fine. Hope this helps anyone with a similar issue.






            share|improve this answer































              3














              I had the same problem. All i did was to remove the dash ("-") from the command.



              Instead of typing it as




              tar -cvfz output.tar.gz folder/




              try typing it as




              tar cvfz output.tar.gz folder/




              I am unaware of why the dash was causing problems in my case but at least it worked.






              share|improve this answer





















              • 6





                You probably tested this with GNU tar. Your confusion comes from the fact that it accepts two different styles of options - the "old-style" tar options without a dash and the "standard unix" options with a dash. The options with dash require an argument of an option to follow the option. So in this case the argument for -f should be output.tar.gz and there must not be z in between. Without re-ordering of the options it would correctly be: tar -cvf output.tar.gz -z folder/. The old style expects all the options in one place and all the arguments follow.

                – pabouk
                Oct 19 '13 at 12:40











              • See the GNU tar documentation and also for example Tru64 UNIX tar man page.

                – pabouk
                Oct 19 '13 at 12:42











              • @pabouk That comment seemed worthy of being an answer by itself. Please add the contents of that comment as an answer to this question so that credit goes where credit is due.

                – cwallenpoole
                May 29 '14 at 13:46













              • I also had problems, but it was a file with the name -v so apparently tar has some bugs with regards to what files it can backup... this should not be a problem. my workaround since rm and mv would not work, was to use a file manager. so apparently mv and rm are buggy too. i tried mv '-v' v and rm '-v' but got error messages. tar mentioned it could not stat the tar file. was using -cfjv

                – Jim Michaels
                Mar 15 '15 at 5:15





















              1














              You have misunderstood an earlier answer. The problem is not the -, it is where the f is in your argument list.



              tar cvfz target.tgz <files>


              Will try to create an archive called "z", as that is the text after f. The error message is because tar can't find "target.gz" to add to archive "z".



              tar cvzf target.tgz <files>


              Will correctly create target.tgz and add files to it. This is because target.tgz is the first text after the f argument.






              share|improve this answer


























              • This should be added as a comment to the "confused" reply. Unfortunately you will be allowed to add such comments only after gaining 50 points of reputation. To the subject: Did you test it? I tested it with GNU tar 1.26 and the variants with and without dash are really different as described in the reply of jack. It behaves as it is written in the reply.

                – pabouk
                Oct 19 '13 at 12:14



















              0














              Usually you can ignore that message. If there are any changes (such as file deletions/creations/modifications) to underlying directory tree during tar creation, it will throw that message. Also if there special files like device nodes, fifos and so on, they will cause that warning.



              Are you sure you can't see any culprit files? Try with tar cvfz yourtarball.tgz /your/path






              share|improve this answer































                0














                I had a similar issue untarring a file I had received. Turns out I didn't have permission to write the files in the archive owned by root. Using sudo fixed it.






                share|improve this answer








                New contributor




                ttwalkertt is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.





















                  Your Answer








                  StackExchange.ready(function() {
                  var channelOptions = {
                  tags: "".split(" "),
                  id: "3"
                  };
                  initTagRenderer("".split(" "), "".split(" "), channelOptions);

                  StackExchange.using("externalEditor", function() {
                  // Have to fire editor after snippets, if snippets enabled
                  if (StackExchange.settings.snippets.snippetsEnabled) {
                  StackExchange.using("snippets", function() {
                  createEditor();
                  });
                  }
                  else {
                  createEditor();
                  }
                  });

                  function createEditor() {
                  StackExchange.prepareEditor({
                  heartbeatType: 'answer',
                  autoActivateHeartbeat: false,
                  convertImagesToLinks: true,
                  noModals: true,
                  showLowRepImageUploadWarning: true,
                  reputationToPostImages: 10,
                  bindNavPrevention: true,
                  postfix: "",
                  imageUploader: {
                  brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
                  contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
                  allowUrls: true
                  },
                  onDemand: true,
                  discardSelector: ".discard-answer"
                  ,immediatelyShowMarkdownHelp:true
                  });


                  }
                  });














                  draft saved

                  draft discarded


















                  StackExchange.ready(
                  function () {
                  StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f169195%2ftar-exiting-with-failure-status-due-to-previous-errors%23new-answer', 'question_page');
                  }
                  );

                  Post as a guest















                  Required, but never shown

























                  8 Answers
                  8






                  active

                  oldest

                  votes








                  8 Answers
                  8






                  active

                  oldest

                  votes









                  active

                  oldest

                  votes






                  active

                  oldest

                  votes









                  89














                  You will get that message if, for any reason, tar can't add all of the specified files to the tar. One if the most common is not having read permission on one of the files. This could be a big problem since you are using this for backup. If you are using the -v flag, try leaving it off. This should reduce the output and let you see what is going on.






                  share|improve this answer



















                  • 8





                    +1 for the suggestion (I was using the 'verbose' option previously). I found that there was a permission issue on at least one of the files. At least now I know how to resolve this. many thanks

                    – morpheous
                    Jul 29 '10 at 14:26













                  • yes using sudo fixed the issue

                    – whizcreed
                    Nov 17 '15 at 12:44


















                  89














                  You will get that message if, for any reason, tar can't add all of the specified files to the tar. One if the most common is not having read permission on one of the files. This could be a big problem since you are using this for backup. If you are using the -v flag, try leaving it off. This should reduce the output and let you see what is going on.






                  share|improve this answer



















                  • 8





                    +1 for the suggestion (I was using the 'verbose' option previously). I found that there was a permission issue on at least one of the files. At least now I know how to resolve this. many thanks

                    – morpheous
                    Jul 29 '10 at 14:26













                  • yes using sudo fixed the issue

                    – whizcreed
                    Nov 17 '15 at 12:44
















                  89












                  89








                  89







                  You will get that message if, for any reason, tar can't add all of the specified files to the tar. One if the most common is not having read permission on one of the files. This could be a big problem since you are using this for backup. If you are using the -v flag, try leaving it off. This should reduce the output and let you see what is going on.






                  share|improve this answer













                  You will get that message if, for any reason, tar can't add all of the specified files to the tar. One if the most common is not having read permission on one of the files. This could be a big problem since you are using this for backup. If you are using the -v flag, try leaving it off. This should reduce the output and let you see what is going on.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Jul 29 '10 at 11:22









                  KeithBKeithB

                  7,92611813




                  7,92611813








                  • 8





                    +1 for the suggestion (I was using the 'verbose' option previously). I found that there was a permission issue on at least one of the files. At least now I know how to resolve this. many thanks

                    – morpheous
                    Jul 29 '10 at 14:26













                  • yes using sudo fixed the issue

                    – whizcreed
                    Nov 17 '15 at 12:44
















                  • 8





                    +1 for the suggestion (I was using the 'verbose' option previously). I found that there was a permission issue on at least one of the files. At least now I know how to resolve this. many thanks

                    – morpheous
                    Jul 29 '10 at 14:26













                  • yes using sudo fixed the issue

                    – whizcreed
                    Nov 17 '15 at 12:44










                  8




                  8





                  +1 for the suggestion (I was using the 'verbose' option previously). I found that there was a permission issue on at least one of the files. At least now I know how to resolve this. many thanks

                  – morpheous
                  Jul 29 '10 at 14:26







                  +1 for the suggestion (I was using the 'verbose' option previously). I found that there was a permission issue on at least one of the files. At least now I know how to resolve this. many thanks

                  – morpheous
                  Jul 29 '10 at 14:26















                  yes using sudo fixed the issue

                  – whizcreed
                  Nov 17 '15 at 12:44







                  yes using sudo fixed the issue

                  – whizcreed
                  Nov 17 '15 at 12:44















                  21














                  the problem is the argument,
                  f argument take the next as the filename, so it must be the last of argument



                  tar cvzf output.tgz folder


                  or



                  tar -cvzf output.tgz folder


                  is the same and no take error.






                  share|improve this answer


























                  • Solved my problem. I was trying tar -zcvfp giving error but when tried tar -zxvpf then all fine. Thanks.

                    – Mian Asbat Ahmad
                    Feb 27 '18 at 10:28
















                  21














                  the problem is the argument,
                  f argument take the next as the filename, so it must be the last of argument



                  tar cvzf output.tgz folder


                  or



                  tar -cvzf output.tgz folder


                  is the same and no take error.






                  share|improve this answer


























                  • Solved my problem. I was trying tar -zcvfp giving error but when tried tar -zxvpf then all fine. Thanks.

                    – Mian Asbat Ahmad
                    Feb 27 '18 at 10:28














                  21












                  21








                  21







                  the problem is the argument,
                  f argument take the next as the filename, so it must be the last of argument



                  tar cvzf output.tgz folder


                  or



                  tar -cvzf output.tgz folder


                  is the same and no take error.






                  share|improve this answer















                  the problem is the argument,
                  f argument take the next as the filename, so it must be the last of argument



                  tar cvzf output.tgz folder


                  or



                  tar -cvzf output.tgz folder


                  is the same and no take error.







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Jan 28 '13 at 11:11









                  RTOSkit

                  550615




                  550615










                  answered Jan 28 '13 at 9:21









                  Andrea MonniAndrea Monni

                  21122




                  21122













                  • Solved my problem. I was trying tar -zcvfp giving error but when tried tar -zxvpf then all fine. Thanks.

                    – Mian Asbat Ahmad
                    Feb 27 '18 at 10:28



















                  • Solved my problem. I was trying tar -zcvfp giving error but when tried tar -zxvpf then all fine. Thanks.

                    – Mian Asbat Ahmad
                    Feb 27 '18 at 10:28

















                  Solved my problem. I was trying tar -zcvfp giving error but when tried tar -zxvpf then all fine. Thanks.

                  – Mian Asbat Ahmad
                  Feb 27 '18 at 10:28





                  Solved my problem. I was trying tar -zcvfp giving error but when tried tar -zxvpf then all fine. Thanks.

                  – Mian Asbat Ahmad
                  Feb 27 '18 at 10:28











                  5














                  Sometimes backing up files that might change during the backup like logfiles, you might find useful the tar option '--ignore-failed-read' (I'm on Debian Linux, not sure for non gnu tar).



                  Standard output and error can be redirected in 2 different files with something like:



                  LOGDIR='/var/log/mylogdir' 
                  LOG=${LOGDIR}/backup.log
                  ERRLOG=${LOGDIR}/backup.error.log
                  DATE=$(date +%Y-%m-%d)
                  HOSTNAME=$(hostname)
                  DATA_DIRS='/etc /home /root'

                  tar --ignore-failed-read -f ${BACKUP_DIR}/${HOSTNAME}-${DATE}.tgz -cvz ${DATA_DIRS} > $LOG 2> $ERRLOG


                  I find this to be generally safe, but please be careful though as tar won't stop ...






                  share|improve this answer




























                    5














                    Sometimes backing up files that might change during the backup like logfiles, you might find useful the tar option '--ignore-failed-read' (I'm on Debian Linux, not sure for non gnu tar).



                    Standard output and error can be redirected in 2 different files with something like:



                    LOGDIR='/var/log/mylogdir' 
                    LOG=${LOGDIR}/backup.log
                    ERRLOG=${LOGDIR}/backup.error.log
                    DATE=$(date +%Y-%m-%d)
                    HOSTNAME=$(hostname)
                    DATA_DIRS='/etc /home /root'

                    tar --ignore-failed-read -f ${BACKUP_DIR}/${HOSTNAME}-${DATE}.tgz -cvz ${DATA_DIRS} > $LOG 2> $ERRLOG


                    I find this to be generally safe, but please be careful though as tar won't stop ...






                    share|improve this answer


























                      5












                      5








                      5







                      Sometimes backing up files that might change during the backup like logfiles, you might find useful the tar option '--ignore-failed-read' (I'm on Debian Linux, not sure for non gnu tar).



                      Standard output and error can be redirected in 2 different files with something like:



                      LOGDIR='/var/log/mylogdir' 
                      LOG=${LOGDIR}/backup.log
                      ERRLOG=${LOGDIR}/backup.error.log
                      DATE=$(date +%Y-%m-%d)
                      HOSTNAME=$(hostname)
                      DATA_DIRS='/etc /home /root'

                      tar --ignore-failed-read -f ${BACKUP_DIR}/${HOSTNAME}-${DATE}.tgz -cvz ${DATA_DIRS} > $LOG 2> $ERRLOG


                      I find this to be generally safe, but please be careful though as tar won't stop ...






                      share|improve this answer













                      Sometimes backing up files that might change during the backup like logfiles, you might find useful the tar option '--ignore-failed-read' (I'm on Debian Linux, not sure for non gnu tar).



                      Standard output and error can be redirected in 2 different files with something like:



                      LOGDIR='/var/log/mylogdir' 
                      LOG=${LOGDIR}/backup.log
                      ERRLOG=${LOGDIR}/backup.error.log
                      DATE=$(date +%Y-%m-%d)
                      HOSTNAME=$(hostname)
                      DATA_DIRS='/etc /home /root'

                      tar --ignore-failed-read -f ${BACKUP_DIR}/${HOSTNAME}-${DATE}.tgz -cvz ${DATA_DIRS} > $LOG 2> $ERRLOG


                      I find this to be generally safe, but please be careful though as tar won't stop ...







                      share|improve this answer












                      share|improve this answer



                      share|improve this answer










                      answered Jan 17 '14 at 12:24









                      Fabio PedrazzoliFabio Pedrazzoli

                      6114




                      6114























                          4














                          I was having the same issue and none of the above answers worked for me. However, I found that running the following command worked:



                          tar -cpzf /backups/fullbackup.tar.gz --exclude=backups --exclude=proc --exclude=tmp --exclude=mnt --exclude=sys --exclude=dev --exclude=run /



                          The errors that were being referred to in tar: Exiting with failure status due to previous errors can be identified by turning off the -v option. Upon review, the errors came from directories like /run and /sys.



                          By excluding these directories, it works just fine. Hope this helps anyone with a similar issue.






                          share|improve this answer




























                            4














                            I was having the same issue and none of the above answers worked for me. However, I found that running the following command worked:



                            tar -cpzf /backups/fullbackup.tar.gz --exclude=backups --exclude=proc --exclude=tmp --exclude=mnt --exclude=sys --exclude=dev --exclude=run /



                            The errors that were being referred to in tar: Exiting with failure status due to previous errors can be identified by turning off the -v option. Upon review, the errors came from directories like /run and /sys.



                            By excluding these directories, it works just fine. Hope this helps anyone with a similar issue.






                            share|improve this answer


























                              4












                              4








                              4







                              I was having the same issue and none of the above answers worked for me. However, I found that running the following command worked:



                              tar -cpzf /backups/fullbackup.tar.gz --exclude=backups --exclude=proc --exclude=tmp --exclude=mnt --exclude=sys --exclude=dev --exclude=run /



                              The errors that were being referred to in tar: Exiting with failure status due to previous errors can be identified by turning off the -v option. Upon review, the errors came from directories like /run and /sys.



                              By excluding these directories, it works just fine. Hope this helps anyone with a similar issue.






                              share|improve this answer













                              I was having the same issue and none of the above answers worked for me. However, I found that running the following command worked:



                              tar -cpzf /backups/fullbackup.tar.gz --exclude=backups --exclude=proc --exclude=tmp --exclude=mnt --exclude=sys --exclude=dev --exclude=run /



                              The errors that were being referred to in tar: Exiting with failure status due to previous errors can be identified by turning off the -v option. Upon review, the errors came from directories like /run and /sys.



                              By excluding these directories, it works just fine. Hope this helps anyone with a similar issue.







                              share|improve this answer












                              share|improve this answer



                              share|improve this answer










                              answered Oct 10 '16 at 15:03









                              DomainsFeaturedDomainsFeatured

                              15919




                              15919























                                  3














                                  I had the same problem. All i did was to remove the dash ("-") from the command.



                                  Instead of typing it as




                                  tar -cvfz output.tar.gz folder/




                                  try typing it as




                                  tar cvfz output.tar.gz folder/




                                  I am unaware of why the dash was causing problems in my case but at least it worked.






                                  share|improve this answer





















                                  • 6





                                    You probably tested this with GNU tar. Your confusion comes from the fact that it accepts two different styles of options - the "old-style" tar options without a dash and the "standard unix" options with a dash. The options with dash require an argument of an option to follow the option. So in this case the argument for -f should be output.tar.gz and there must not be z in between. Without re-ordering of the options it would correctly be: tar -cvf output.tar.gz -z folder/. The old style expects all the options in one place and all the arguments follow.

                                    – pabouk
                                    Oct 19 '13 at 12:40











                                  • See the GNU tar documentation and also for example Tru64 UNIX tar man page.

                                    – pabouk
                                    Oct 19 '13 at 12:42











                                  • @pabouk That comment seemed worthy of being an answer by itself. Please add the contents of that comment as an answer to this question so that credit goes where credit is due.

                                    – cwallenpoole
                                    May 29 '14 at 13:46













                                  • I also had problems, but it was a file with the name -v so apparently tar has some bugs with regards to what files it can backup... this should not be a problem. my workaround since rm and mv would not work, was to use a file manager. so apparently mv and rm are buggy too. i tried mv '-v' v and rm '-v' but got error messages. tar mentioned it could not stat the tar file. was using -cfjv

                                    – Jim Michaels
                                    Mar 15 '15 at 5:15


















                                  3














                                  I had the same problem. All i did was to remove the dash ("-") from the command.



                                  Instead of typing it as




                                  tar -cvfz output.tar.gz folder/




                                  try typing it as




                                  tar cvfz output.tar.gz folder/




                                  I am unaware of why the dash was causing problems in my case but at least it worked.






                                  share|improve this answer





















                                  • 6





                                    You probably tested this with GNU tar. Your confusion comes from the fact that it accepts two different styles of options - the "old-style" tar options without a dash and the "standard unix" options with a dash. The options with dash require an argument of an option to follow the option. So in this case the argument for -f should be output.tar.gz and there must not be z in between. Without re-ordering of the options it would correctly be: tar -cvf output.tar.gz -z folder/. The old style expects all the options in one place and all the arguments follow.

                                    – pabouk
                                    Oct 19 '13 at 12:40











                                  • See the GNU tar documentation and also for example Tru64 UNIX tar man page.

                                    – pabouk
                                    Oct 19 '13 at 12:42











                                  • @pabouk That comment seemed worthy of being an answer by itself. Please add the contents of that comment as an answer to this question so that credit goes where credit is due.

                                    – cwallenpoole
                                    May 29 '14 at 13:46













                                  • I also had problems, but it was a file with the name -v so apparently tar has some bugs with regards to what files it can backup... this should not be a problem. my workaround since rm and mv would not work, was to use a file manager. so apparently mv and rm are buggy too. i tried mv '-v' v and rm '-v' but got error messages. tar mentioned it could not stat the tar file. was using -cfjv

                                    – Jim Michaels
                                    Mar 15 '15 at 5:15
















                                  3












                                  3








                                  3







                                  I had the same problem. All i did was to remove the dash ("-") from the command.



                                  Instead of typing it as




                                  tar -cvfz output.tar.gz folder/




                                  try typing it as




                                  tar cvfz output.tar.gz folder/




                                  I am unaware of why the dash was causing problems in my case but at least it worked.






                                  share|improve this answer















                                  I had the same problem. All i did was to remove the dash ("-") from the command.



                                  Instead of typing it as




                                  tar -cvfz output.tar.gz folder/




                                  try typing it as




                                  tar cvfz output.tar.gz folder/




                                  I am unaware of why the dash was causing problems in my case but at least it worked.







                                  share|improve this answer














                                  share|improve this answer



                                  share|improve this answer








                                  edited Dec 31 '11 at 13:11









                                  Tak

                                  25314




                                  25314










                                  answered Sep 10 '11 at 23:06









                                  jackjack

                                  311




                                  311








                                  • 6





                                    You probably tested this with GNU tar. Your confusion comes from the fact that it accepts two different styles of options - the "old-style" tar options without a dash and the "standard unix" options with a dash. The options with dash require an argument of an option to follow the option. So in this case the argument for -f should be output.tar.gz and there must not be z in between. Without re-ordering of the options it would correctly be: tar -cvf output.tar.gz -z folder/. The old style expects all the options in one place and all the arguments follow.

                                    – pabouk
                                    Oct 19 '13 at 12:40











                                  • See the GNU tar documentation and also for example Tru64 UNIX tar man page.

                                    – pabouk
                                    Oct 19 '13 at 12:42











                                  • @pabouk That comment seemed worthy of being an answer by itself. Please add the contents of that comment as an answer to this question so that credit goes where credit is due.

                                    – cwallenpoole
                                    May 29 '14 at 13:46













                                  • I also had problems, but it was a file with the name -v so apparently tar has some bugs with regards to what files it can backup... this should not be a problem. my workaround since rm and mv would not work, was to use a file manager. so apparently mv and rm are buggy too. i tried mv '-v' v and rm '-v' but got error messages. tar mentioned it could not stat the tar file. was using -cfjv

                                    – Jim Michaels
                                    Mar 15 '15 at 5:15
















                                  • 6





                                    You probably tested this with GNU tar. Your confusion comes from the fact that it accepts two different styles of options - the "old-style" tar options without a dash and the "standard unix" options with a dash. The options with dash require an argument of an option to follow the option. So in this case the argument for -f should be output.tar.gz and there must not be z in between. Without re-ordering of the options it would correctly be: tar -cvf output.tar.gz -z folder/. The old style expects all the options in one place and all the arguments follow.

                                    – pabouk
                                    Oct 19 '13 at 12:40











                                  • See the GNU tar documentation and also for example Tru64 UNIX tar man page.

                                    – pabouk
                                    Oct 19 '13 at 12:42











                                  • @pabouk That comment seemed worthy of being an answer by itself. Please add the contents of that comment as an answer to this question so that credit goes where credit is due.

                                    – cwallenpoole
                                    May 29 '14 at 13:46













                                  • I also had problems, but it was a file with the name -v so apparently tar has some bugs with regards to what files it can backup... this should not be a problem. my workaround since rm and mv would not work, was to use a file manager. so apparently mv and rm are buggy too. i tried mv '-v' v and rm '-v' but got error messages. tar mentioned it could not stat the tar file. was using -cfjv

                                    – Jim Michaels
                                    Mar 15 '15 at 5:15










                                  6




                                  6





                                  You probably tested this with GNU tar. Your confusion comes from the fact that it accepts two different styles of options - the "old-style" tar options without a dash and the "standard unix" options with a dash. The options with dash require an argument of an option to follow the option. So in this case the argument for -f should be output.tar.gz and there must not be z in between. Without re-ordering of the options it would correctly be: tar -cvf output.tar.gz -z folder/. The old style expects all the options in one place and all the arguments follow.

                                  – pabouk
                                  Oct 19 '13 at 12:40





                                  You probably tested this with GNU tar. Your confusion comes from the fact that it accepts two different styles of options - the "old-style" tar options without a dash and the "standard unix" options with a dash. The options with dash require an argument of an option to follow the option. So in this case the argument for -f should be output.tar.gz and there must not be z in between. Without re-ordering of the options it would correctly be: tar -cvf output.tar.gz -z folder/. The old style expects all the options in one place and all the arguments follow.

                                  – pabouk
                                  Oct 19 '13 at 12:40













                                  See the GNU tar documentation and also for example Tru64 UNIX tar man page.

                                  – pabouk
                                  Oct 19 '13 at 12:42





                                  See the GNU tar documentation and also for example Tru64 UNIX tar man page.

                                  – pabouk
                                  Oct 19 '13 at 12:42













                                  @pabouk That comment seemed worthy of being an answer by itself. Please add the contents of that comment as an answer to this question so that credit goes where credit is due.

                                  – cwallenpoole
                                  May 29 '14 at 13:46







                                  @pabouk That comment seemed worthy of being an answer by itself. Please add the contents of that comment as an answer to this question so that credit goes where credit is due.

                                  – cwallenpoole
                                  May 29 '14 at 13:46















                                  I also had problems, but it was a file with the name -v so apparently tar has some bugs with regards to what files it can backup... this should not be a problem. my workaround since rm and mv would not work, was to use a file manager. so apparently mv and rm are buggy too. i tried mv '-v' v and rm '-v' but got error messages. tar mentioned it could not stat the tar file. was using -cfjv

                                  – Jim Michaels
                                  Mar 15 '15 at 5:15







                                  I also had problems, but it was a file with the name -v so apparently tar has some bugs with regards to what files it can backup... this should not be a problem. my workaround since rm and mv would not work, was to use a file manager. so apparently mv and rm are buggy too. i tried mv '-v' v and rm '-v' but got error messages. tar mentioned it could not stat the tar file. was using -cfjv

                                  – Jim Michaels
                                  Mar 15 '15 at 5:15













                                  1














                                  You have misunderstood an earlier answer. The problem is not the -, it is where the f is in your argument list.



                                  tar cvfz target.tgz <files>


                                  Will try to create an archive called "z", as that is the text after f. The error message is because tar can't find "target.gz" to add to archive "z".



                                  tar cvzf target.tgz <files>


                                  Will correctly create target.tgz and add files to it. This is because target.tgz is the first text after the f argument.






                                  share|improve this answer


























                                  • This should be added as a comment to the "confused" reply. Unfortunately you will be allowed to add such comments only after gaining 50 points of reputation. To the subject: Did you test it? I tested it with GNU tar 1.26 and the variants with and without dash are really different as described in the reply of jack. It behaves as it is written in the reply.

                                    – pabouk
                                    Oct 19 '13 at 12:14
















                                  1














                                  You have misunderstood an earlier answer. The problem is not the -, it is where the f is in your argument list.



                                  tar cvfz target.tgz <files>


                                  Will try to create an archive called "z", as that is the text after f. The error message is because tar can't find "target.gz" to add to archive "z".



                                  tar cvzf target.tgz <files>


                                  Will correctly create target.tgz and add files to it. This is because target.tgz is the first text after the f argument.






                                  share|improve this answer


























                                  • This should be added as a comment to the "confused" reply. Unfortunately you will be allowed to add such comments only after gaining 50 points of reputation. To the subject: Did you test it? I tested it with GNU tar 1.26 and the variants with and without dash are really different as described in the reply of jack. It behaves as it is written in the reply.

                                    – pabouk
                                    Oct 19 '13 at 12:14














                                  1












                                  1








                                  1







                                  You have misunderstood an earlier answer. The problem is not the -, it is where the f is in your argument list.



                                  tar cvfz target.tgz <files>


                                  Will try to create an archive called "z", as that is the text after f. The error message is because tar can't find "target.gz" to add to archive "z".



                                  tar cvzf target.tgz <files>


                                  Will correctly create target.tgz and add files to it. This is because target.tgz is the first text after the f argument.






                                  share|improve this answer















                                  You have misunderstood an earlier answer. The problem is not the -, it is where the f is in your argument list.



                                  tar cvfz target.tgz <files>


                                  Will try to create an archive called "z", as that is the text after f. The error message is because tar can't find "target.gz" to add to archive "z".



                                  tar cvzf target.tgz <files>


                                  Will correctly create target.tgz and add files to it. This is because target.tgz is the first text after the f argument.







                                  share|improve this answer














                                  share|improve this answer



                                  share|improve this answer








                                  edited Dec 12 '13 at 9:50









                                  Jamie Taylor

                                  50631126




                                  50631126










                                  answered Oct 19 '13 at 7:52









                                  ThornburyThornbury

                                  111




                                  111













                                  • This should be added as a comment to the "confused" reply. Unfortunately you will be allowed to add such comments only after gaining 50 points of reputation. To the subject: Did you test it? I tested it with GNU tar 1.26 and the variants with and without dash are really different as described in the reply of jack. It behaves as it is written in the reply.

                                    – pabouk
                                    Oct 19 '13 at 12:14



















                                  • This should be added as a comment to the "confused" reply. Unfortunately you will be allowed to add such comments only after gaining 50 points of reputation. To the subject: Did you test it? I tested it with GNU tar 1.26 and the variants with and without dash are really different as described in the reply of jack. It behaves as it is written in the reply.

                                    – pabouk
                                    Oct 19 '13 at 12:14

















                                  This should be added as a comment to the "confused" reply. Unfortunately you will be allowed to add such comments only after gaining 50 points of reputation. To the subject: Did you test it? I tested it with GNU tar 1.26 and the variants with and without dash are really different as described in the reply of jack. It behaves as it is written in the reply.

                                  – pabouk
                                  Oct 19 '13 at 12:14





                                  This should be added as a comment to the "confused" reply. Unfortunately you will be allowed to add such comments only after gaining 50 points of reputation. To the subject: Did you test it? I tested it with GNU tar 1.26 and the variants with and without dash are really different as described in the reply of jack. It behaves as it is written in the reply.

                                  – pabouk
                                  Oct 19 '13 at 12:14











                                  0














                                  Usually you can ignore that message. If there are any changes (such as file deletions/creations/modifications) to underlying directory tree during tar creation, it will throw that message. Also if there special files like device nodes, fifos and so on, they will cause that warning.



                                  Are you sure you can't see any culprit files? Try with tar cvfz yourtarball.tgz /your/path






                                  share|improve this answer




























                                    0














                                    Usually you can ignore that message. If there are any changes (such as file deletions/creations/modifications) to underlying directory tree during tar creation, it will throw that message. Also if there special files like device nodes, fifos and so on, they will cause that warning.



                                    Are you sure you can't see any culprit files? Try with tar cvfz yourtarball.tgz /your/path






                                    share|improve this answer


























                                      0












                                      0








                                      0







                                      Usually you can ignore that message. If there are any changes (such as file deletions/creations/modifications) to underlying directory tree during tar creation, it will throw that message. Also if there special files like device nodes, fifos and so on, they will cause that warning.



                                      Are you sure you can't see any culprit files? Try with tar cvfz yourtarball.tgz /your/path






                                      share|improve this answer













                                      Usually you can ignore that message. If there are any changes (such as file deletions/creations/modifications) to underlying directory tree during tar creation, it will throw that message. Also if there special files like device nodes, fifos and so on, they will cause that warning.



                                      Are you sure you can't see any culprit files? Try with tar cvfz yourtarball.tgz /your/path







                                      share|improve this answer












                                      share|improve this answer



                                      share|improve this answer










                                      answered Jul 29 '10 at 7:26









                                      Janne PikkarainenJanne Pikkarainen

                                      6,29912329




                                      6,29912329























                                          0














                                          I had a similar issue untarring a file I had received. Turns out I didn't have permission to write the files in the archive owned by root. Using sudo fixed it.






                                          share|improve this answer








                                          New contributor




                                          ttwalkertt is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                          Check out our Code of Conduct.

























                                            0














                                            I had a similar issue untarring a file I had received. Turns out I didn't have permission to write the files in the archive owned by root. Using sudo fixed it.






                                            share|improve this answer








                                            New contributor




                                            ttwalkertt is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                            Check out our Code of Conduct.























                                              0












                                              0








                                              0







                                              I had a similar issue untarring a file I had received. Turns out I didn't have permission to write the files in the archive owned by root. Using sudo fixed it.






                                              share|improve this answer








                                              New contributor




                                              ttwalkertt is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                              Check out our Code of Conduct.










                                              I had a similar issue untarring a file I had received. Turns out I didn't have permission to write the files in the archive owned by root. Using sudo fixed it.







                                              share|improve this answer








                                              New contributor




                                              ttwalkertt is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                              Check out our Code of Conduct.









                                              share|improve this answer



                                              share|improve this answer






                                              New contributor




                                              ttwalkertt is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                              Check out our Code of Conduct.









                                              answered 11 hours ago









                                              ttwalkerttttwalkertt

                                              1




                                              1




                                              New contributor




                                              ttwalkertt is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                              Check out our Code of Conduct.





                                              New contributor





                                              ttwalkertt is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                              Check out our Code of Conduct.






                                              ttwalkertt is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                              Check out our Code of Conduct.






























                                                  draft saved

                                                  draft discarded




















































                                                  Thanks for contributing an answer to Super User!


                                                  • Please be sure to answer the question. Provide details and share your research!

                                                  But avoid



                                                  • Asking for help, clarification, or responding to other answers.

                                                  • Making statements based on opinion; back them up with references or personal experience.


                                                  To learn more, see our tips on writing great answers.




                                                  draft saved


                                                  draft discarded














                                                  StackExchange.ready(
                                                  function () {
                                                  StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f169195%2ftar-exiting-with-failure-status-due-to-previous-errors%23new-answer', 'question_page');
                                                  }
                                                  );

                                                  Post as a guest















                                                  Required, but never shown





















































                                                  Required, but never shown














                                                  Required, but never shown












                                                  Required, but never shown







                                                  Required, but never shown

































                                                  Required, but never shown














                                                  Required, but never shown












                                                  Required, but never shown







                                                  Required, but never shown







                                                  Popular posts from this blog

                                                  Couldn't open a raw socket. Error: Permission denied (13) (nmap)Is it possible to run networking commands...

                                                  VNC viewer RFB protocol error: bad desktop size 0x0I Cannot Type the Key 'd' (lowercase) in VNC Viewer...

                                                  Why not use the yoke to control yaw, as well as pitch and roll? Announcing the arrival of...