problem : when I try to create a compressed file with tar command, I always fail in the process of execution, and throw an error description “tar: exiting with failure status due to previous errors”
If you encounter the following error when you execute the tar command, the most likely reason is that you do not have read permission for a file you want to compress with the tar command
tar: Exiting with failure status due to previous errors
So how do we identify the file (s) that caused the error?Or how to identify other sources of error
In fact, the tar command should print out what the so-called “previous errors” are, but if you let tar run in detailed mode (i.e. – CVF), you will easily miss this information. To find this information, you can filter out tar’s stdout information as follows
tar zcvf backup.tar.gz my_program/ > /dev/null
and then you’ll see the stderr output from tar( Lctt: naturally, it’s OK without the V parameter.)
tar: my_program/src/lib/.conf.db.~lock~: Cannot open: Permission denied
tar: Exiting with failure status due to previous errors
As you can see from the above example, the cause of the error is indeed “denied read permission”. To solve this problem, simply change (or remove) the permission of the problem file, and then re execute the tar command
Similar Posts:
- [Solved] Operating system error 995(The I/O operation has been aborted because of either a thread)
- [Solved] npm install Error: github requires permissions, Permission denied (publickey)
- [Solved] Git Bash error: could not lock config file Java/jdk1.7.0_71/.gitconfig: Permission denied
- Groovy executes the script command shell command [Solved]
- ZABBIX server startup error resolution
- NRPE: Unable to read output [How to Solve]
- [Solved] log4j:WARN No appenders could be found for logger
- How to Solve Error: Linux permission denied
- Docker Django: underlying buffer has been detached [How to Solve]
- How to Sovle mysqldump backup Error on the MySQL command line