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
asked Jul 29, 2010 at 7:17
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.
answered Jul 29, 2010 at 11:22
KeithBKeithB
9,7862 gold badges22 silver badges16 bronze badges
3
The problem is the f argument. It takes the next value as the filename, so it must be the last argument:
tar cvzf output.tgz folder
or:
tar -cvzf output.tgz folder
These are both the same and don’t produce an error.
![]()
Worthwelle
4,41811 gold badges19 silver badges31 bronze badges
answered Jan 28, 2013 at 9:21
1
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 …
answered Jan 17, 2014 at 12:24
0
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.
answered Oct 10, 2016 at 15:03
DomainsFeaturedDomainsFeatured
1891 gold badge2 silver badges9 bronze badges
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.
Tak
2832 silver badges5 bronze badges
answered Sep 10, 2011 at 23:06
4
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.
Jamie Taylor
1,3313 gold badges17 silver badges27 bronze badges
answered Oct 19, 2013 at 7:52
1
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
answered Jul 29, 2010 at 7:26
![]()
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.
answered Apr 23, 2019 at 18:33
I am trying to backup my Ubuntu workstation by the help of this guide and are running into trouble as the tar command outputs
Exiting with failure status due to previous errors.
Here’s what I ran in terminal:
sudo -i
cd /
tar -cvpzf sysbackup-20110821.tar.gz
--exclude=/sysbackup-20110821.tar.gz
--exclude=/proc
--exclude=/lost+found
--exclude=/sys
--exclude=/mnt
--exclude=/media
--exclude=/dev /
So from searching a bit, the error seems to be of a non-critical nature, but as I checkout the contents of the actual .tar file, my /home-folder is missing, so obviously something went clearly wrong.
What should I do instead to backup my system without errors?
enzotib
90.2k11 gold badges162 silver badges175 bronze badges
asked Aug 21, 2011 at 20:11
7
I suggest a command line as the following:
tar -cvpzf sysbackup-20110821.tar.gz --one-file-system
--exclude=/sysbackup-20110821.tar.gz
--exclude=./run
--exclude=./tmp
--exclude='./home/*/.gvfs' ./
As you see, every exclude pattern becomes a relative path, and the --one-file-system option excludes /dev, /proc, /sys, and everything mounted under /media or /mnt.
Nevertheless, if you have a separate home partition, this is not backed up.
Tested on 11.10 (Oneiric, alpha3). Probably, in previous ubuntu versions you should exclude ./var/run, instead of /run.
answered Aug 22, 2011 at 9:03
enzotibenzotib
90.2k11 gold badges162 silver badges175 bronze badges
0
Right click,choose «Extract here«. I use this way to resolve another familiar problem. But I don’t know why it can work. It looks incredibly simple, isn’t it? Hopefully that can help you.
answered Mar 30, 2017 at 6:58
![]()
JNingJNing
6031 gold badge5 silver badges10 bronze badges
I’m trying to tar some database files in case something goes sideways during an upgrade. The database has been stopped so there are no sockets:
# systemctl stop rh-mariadb102-mariadb.service
#
When I run tar on the directory of interest, it fails with:
# tar -cvfz mysql.tar.gz mysql/
...
mysql/ibdata1
mysql/aria_log_control
tar: Exiting with failure status due to previous errors
The output does not show any errors. I am running as root and I have access to the files. For example:
# ls -Al mysql/aria_log_control
-rw-rw---- 1 mysql mysql 52 Dec 21 13:35 mysql/aria_log_control
What is the error, and how do I fix it?
The tar(1) man page is kind of brief, but here are the examples it provides:
TAR(1) User Commands
NAME
tar - manual page for tar 1.26
SYNOPSIS
tar [OPTION...] [FILE]...
DESCRIPTION
GNU `tar' saves many files together into a single tape or disk archive,
and can restore individual files from the archive.
...
EXAMPLES
tar -cf archive.tar foo bar
# Create archive.tar from files foo and bar.
tar -tvf archive.tar
# List all files in archive.tar verbosely.
tar -xf archive.tar
# Extract all files from archive.tar.
Here is the full output of the command.
# tar -cvfz mysql.tar.gz mysql/
tar: mysql.tar.gz: Cannot stat: No such file or directory
mysql/
mysql/ib_logfile0
mysql/mysql/
mysql/mysql/host.MYI
mysql/mysql/ndb_binlog_index.frm
mysql/mysql/general_log.CSV
mysql/mysql/columns_priv.MYD
mysql/mysql/help_keyword.MYI
mysql/mysql/user.MYD
mysql/mysql/help_category.frm
mysql/mysql/time_zone_transition_type.MYD
mysql/mysql/time_zone_transition.MYI
mysql/mysql/time_zone_name.MYD
mysql/mysql/db.MYD
mysql/mysql/time_zone_transition.MYD
mysql/mysql/time_zone_transition_type.MYI
mysql/mysql/plugin.frm
mysql/mysql/proxies_priv.MYI
mysql/mysql/help_relation.MYI
mysql/mysql/procs_priv.frm
mysql/mysql/user.frm
mysql/mysql/slow_log.frm
mysql/mysql/slow_log.CSV
mysql/mysql/help_topic.frm
mysql/mysql/db.MYI
mysql/mysql/host.MYD
mysql/mysql/help_category.MYD
mysql/mysql/time_zone.MYD
mysql/mysql/time_zone_name.frm
mysql/mysql/procs_priv.MYD
mysql/mysql/time_zone_leap_second.MYD
mysql/mysql/help_category.MYI
mysql/mysql/help_topic.MYD
mysql/mysql/time_zone.MYI
mysql/mysql/event.MYI
mysql/mysql/time_zone_transition.frm
mysql/mysql/plugin.MYD
mysql/mysql/time_zone.frm
mysql/mysql/time_zone_leap_second.frm
mysql/mysql/time_zone_transition_type.frm
mysql/mysql/plugin.MYI
mysql/mysql/procs_priv.MYI
mysql/mysql/proxies_priv.frm
mysql/mysql/proc.MYI
mysql/mysql/time_zone_name.MYI
mysql/mysql/tables_priv.MYD
mysql/mysql/user.MYI
mysql/mysql/help_relation.MYD
mysql/mysql/event.MYD
mysql/mysql/host.frm
mysql/mysql/ndb_binlog_index.MYD
mysql/mysql/time_zone_leap_second.MYI
mysql/mysql/servers.MYD
mysql/mysql/general_log.CSM
mysql/mysql/servers.frm
mysql/mysql/db.frm
mysql/mysql/func.MYD
mysql/mysql/slow_log.CSM
mysql/mysql/help_topic.MYI
mysql/mysql/proxies_priv.MYD
mysql/mysql/proc.frm
mysql/mysql/tables_priv.frm
mysql/mysql/ndb_binlog_index.MYI
mysql/mysql/func.MYI
mysql/mysql/columns_priv.frm
mysql/mysql/general_log.frm
mysql/mysql/columns_priv.MYI
mysql/mysql/tables_priv.MYI
mysql/mysql/func.frm
mysql/mysql/help_keyword.MYD
mysql/mysql/servers.MYI
mysql/mysql/help_relation.frm
mysql/mysql/help_keyword.frm
mysql/mysql/event.frm
mysql/mysql/proc.MYD
mysql/my_wiki/
mysql/my_wiki/wikicryptopp_uploadstash.MYI
mysql/my_wiki/wikilounge_objectcache.MYI
mysql/my_wiki/wikilounge_user_groups.MYD
mysql/my_wiki/wikicryptopp_revision.frm
mysql/my_wiki/wikicryptopp_page_props.frm
mysql/my_wiki/wikilounge_watchlist.frm
mysql/my_wiki/wikilounge_math.MYI
mysql/my_wiki/wikilounge_langlinks.MYD
mysql/my_wiki/wikicryptopp_archive.MYD
mysql/my_wiki/wikilounge_imagelinks.MYI
mysql/my_wiki/wikicryptopp_msg_resource.MYI
mysql/my_wiki/wikilounge_smw_specialprops.MYI
mysql/my_wiki/wikilounge_imagelinks.MYD
mysql/my_wiki/wikicryptopp_sites.MYD
mysql/my_wiki/wikilounge_site_stats.MYI
mysql/my_wiki/wikilounge_templatelinks.MYD
mysql/my_wiki/wikicryptopp_site_identifiers.frm
mysql/my_wiki/wikicryptopp_watchlist.MYI
mysql/my_wiki/wikicryptopp_searchindex.frm
mysql/my_wiki/wikilounge_revision.MYD
mysql/my_wiki/wikicryptopp_site_stats.MYI
mysql/my_wiki/wikicryptopp_text.MYD
mysql/my_wiki/wikilounge_archive.MYI
mysql/my_wiki/wikicryptopp_recentchanges.MYD
mysql/my_wiki/wikicryptopp_image.frm
mysql/my_wiki/wikicryptopp_site_identifiers.MYD
mysql/my_wiki/wikicryptopp_iwlinks.frm
mysql/my_wiki/wikilounge_transcache.frm
mysql/my_wiki/wikicryptopp_user_former_groups.MYD
mysql/my_wiki/wikilounge_querycache_info.frm
mysql/my_wiki/wikicryptopp_trackbacks.frm
mysql/my_wiki/wikilounge_image.MYD
mysql/my_wiki/wikicryptopp_log_search.frm
mysql/my_wiki/wikicryptopp_objectcache.frm
mysql/my_wiki/wikilounge_langlinks.frm
mysql/my_wiki/wikicryptopp_sites.MYI
mysql/my_wiki/wikicryptopp_pagelinks.MYD
mysql/my_wiki/wikilounge_pagelinks.frm
mysql/my_wiki/wikicryptopp_module_deps.MYD
mysql/my_wiki/wikicryptopp_category.frm
mysql/my_wiki/wikicryptopp_site_stats.frm
mysql/my_wiki/wikicryptopp_templatelinks.MYI
mysql/my_wiki/wikicryptopp_transcache.MYD
mysql/my_wiki/wikicryptopp_searchindex.MYI
mysql/my_wiki/wikilounge_filearchive.frm
mysql/my_wiki/wikicryptopp_text.frm
mysql/my_wiki/wikilounge_smw_attributes.MYD
mysql/my_wiki/wikicryptopp_querycache.MYD
mysql/my_wiki/wikilounge_trackbacks.MYI
mysql/my_wiki/wikicryptopp_user_newtalk.MYD
mysql/my_wiki/wikilounge_objectcache.MYD
mysql/my_wiki/wikilounge_site_stats.MYD
mysql/my_wiki/wikilounge_categorylinks.MYD
mysql/my_wiki/wikicryptopp_watchlist.frm
mysql/my_wiki/wikicryptopp_iwlinks.MYI
mysql/my_wiki/wikilounge_text.MYD
mysql/my_wiki/wikicryptopp_job.MYD
mysql/my_wiki/wikilounge_logging.frm
mysql/my_wiki/wikicryptopp_revision.MYD
mysql/my_wiki/wikilounge_searchindex.MYD
mysql/my_wiki/wikicryptopp_categorylinks.MYI
mysql/my_wiki/wikilounge_revision.MYI
mysql/my_wiki/wikilounge_langlinks.MYI
mysql/my_wiki/wikicryptopp_user.MYI
mysql/my_wiki/wikicryptopp_querycache_info.frm
mysql/my_wiki/wikilounge_imagelinks.frm
mysql/my_wiki/wikicryptopp_page.MYD
mysql/my_wiki/wikicryptopp_trackbacks.MYI
mysql/my_wiki/wikicryptopp_ipblocks.MYI
mysql/my_wiki/wikicryptopp_page.frm
mysql/my_wiki/wikilounge_text.frm
mysql/my_wiki/wikilounge_job.MYD
mysql/my_wiki/wikicryptopp_user_former_groups.frm
mysql/my_wiki/wikilounge_categorylinks.MYI
mysql/my_wiki/wikicryptopp_interwiki.MYD
mysql/my_wiki/wikicryptopp_valid_tag.frm
mysql/my_wiki/wikicryptopp_protected_titles.frm
mysql/my_wiki/wikicryptopp_site_stats.MYD
mysql/my_wiki/wikicryptopp_interwiki.MYI
mysql/my_wiki/wikicryptopp_uploadstash.MYD
mysql/my_wiki/wikilounge_categorylinks.frm
mysql/my_wiki/wikilounge_ipblocks.frm
mysql/my_wiki/wikicryptopp_iwlinks.MYD
mysql/my_wiki/db.opt
mysql/my_wiki/wikilounge_user_newtalk.MYI
mysql/my_wiki/wikicryptopp_module_deps.frm
mysql/my_wiki/wikicryptopp_user.frm
mysql/my_wiki/wikilounge_smw_specialprops.frm
mysql/my_wiki/wikilounge_image.frm
mysql/my_wiki/wikicryptopp_math.MYI
mysql/my_wiki/wikilounge_trackbacks.frm
mysql/my_wiki/wikilounge_filearchive.MYI
mysql/my_wiki/wikicryptopp_archive.frm
mysql/my_wiki/wikilounge_watchlist.MYI
mysql/my_wiki/wikicryptopp_transcache.frm
mysql/my_wiki/wikicryptopp_ipblocks.frm
mysql/my_wiki/wikilounge_smw_relations.MYD
mysql/my_wiki/wikicryptopp_imagelinks.MYD
mysql/my_wiki/wikilounge_page.frm
mysql/my_wiki/wikilounge_transcache.MYI
mysql/my_wiki/wikilounge_templatelinks.frm
mysql/my_wiki/wikilounge_querycache_info.MYI
mysql/my_wiki/wikilounge_oldimage.MYD
mysql/my_wiki/wikilounge_recentchanges.MYD
mysql/my_wiki/wikilounge_archive.frm
mysql/my_wiki/wikilounge_recentchanges.MYI
mysql/my_wiki/wikicryptopp_user.MYD
mysql/my_wiki/wikicryptopp_user_newtalk.frm
mysql/my_wiki/wikilounge_interwiki.frm
mysql/my_wiki/wikicryptopp_change_tag.frm
mysql/my_wiki/wikicryptopp_site_identifiers.MYI
mysql/my_wiki/wikilounge_site_stats.frm
mysql/my_wiki/wikicryptopp_externallinks.frm
mysql/my_wiki/wikicryptopp_filearchive.frm
mysql/my_wiki/wikicryptopp_langlinks.frm
mysql/my_wiki/wikilounge_ipblocks.MYI
mysql/my_wiki/wikilounge_searchindex.frm
mysql/my_wiki/wikilounge_watchlist.MYD
mysql/my_wiki/wikicryptopp_objectcache.MYI
mysql/my_wiki/wikicryptopp_querycache.MYI
mysql/my_wiki/wikilounge_smw_specialprops.MYD
mysql/my_wiki/wikicryptopp_math.MYD
mysql/my_wiki/wikicryptopp_msg_resource.MYD
mysql/my_wiki/wikicryptopp_filearchive.MYI
mysql/my_wiki/wikicryptopp_image.MYI
mysql/my_wiki/wikicryptopp_module_deps.MYI
mysql/my_wiki/wikicryptopp_redirect.frm
mysql/my_wiki/wikilounge_job.frm
mysql/my_wiki/wikicryptopp_querycache.frm
mysql/my_wiki/wikicryptopp_msg_resource.frm
mysql/my_wiki/wikicryptopp_user_groups.MYI
mysql/my_wiki/wikilounge_smw_attributes.frm
mysql/my_wiki/wikicryptopp_categorylinks.MYD
mysql/my_wiki/wikilounge_interwiki.MYD
mysql/my_wiki/wikilounge_objectcache.frm
mysql/my_wiki/wikicryptopp_objectcache.MYD
mysql/my_wiki/wikilounge_logging.MYI
mysql/my_wiki/wikicryptopp_sites.frm
mysql/my_wiki/wikicryptopp_oldimage.MYI
mysql/my_wiki/wikicryptopp_querycachetwo.frm
mysql/my_wiki/wikicryptopp_langlinks.MYI
mysql/my_wiki/wikicryptopp_msg_resource_links.frm
mysql/my_wiki/wikicryptopp_templatelinks.MYD
mysql/my_wiki/wikicryptopp_filearchive.MYD
mysql/my_wiki/wikicryptopp_page_restrictions.frm
mysql/my_wiki/wikilounge_oldimage.frm
mysql/my_wiki/wikilounge_math.frm
mysql/my_wiki/wikilounge_querycache.MYI
mysql/my_wiki/wikilounge_page.MYI
mysql/my_wiki/wikicryptopp_logging.frm
mysql/my_wiki/wikilounge_user_groups.frm
mysql/my_wiki/wikicryptopp_user_groups.frm
mysql/my_wiki/wikilounge_smw_attributes.MYI
mysql/my_wiki/wikicryptopp_external_user.frm
mysql/my_wiki/wikicryptopp_user_groups.MYD
mysql/my_wiki/wikicryptopp_externallinks.MYI
mysql/my_wiki/wikicryptopp_trackbacks.MYD
mysql/my_wiki/wikilounge_interwiki.MYI
mysql/my_wiki/wikilounge_pagelinks.MYI
mysql/my_wiki/wikilounge_revision.frm
mysql/my_wiki/wikicryptopp_user_former_groups.MYI
mysql/my_wiki/wikicryptopp_msg_resource_links.MYD
mysql/my_wiki/wikilounge_user.MYD
mysql/my_wiki/wikilounge_image.MYI
mysql/my_wiki/wikilounge_transcache.MYD
mysql/my_wiki/wikicryptopp_querycache_info.MYI
mysql/my_wiki/wikilounge_recentchanges.frm
mysql/my_wiki/wikicryptopp_imagelinks.MYI
mysql/my_wiki/wikilounge_user_newtalk.frm
mysql/my_wiki/wikicryptopp_pagelinks.frm
mysql/my_wiki/wikicryptopp_imagelinks.frm
mysql/my_wiki/wikicryptopp_transcache.MYI
mysql/my_wiki/wikicryptopp_job.frm
mysql/my_wiki/wikilounge_externallinks.MYI
mysql/my_wiki/wikilounge_querycache.MYD
mysql/my_wiki/wikicryptopp_msg_resource_links.MYI
mysql/my_wiki/wikicryptopp_interwiki.frm
mysql/my_wiki/wikicryptopp_templatelinks.frm
mysql/my_wiki/wikilounge_text.MYI
mysql/my_wiki/wikicryptopp_revision.MYI
mysql/my_wiki/wikicryptopp_querycache_info.MYD
mysql/my_wiki/wikicryptopp_math.frm
mysql/my_wiki/wikicryptopp_updatelog.frm
mysql/my_wiki/wikilounge_smw_relations.MYI
mysql/my_wiki/wikilounge_pagelinks.MYD
mysql/my_wiki/wikilounge_trackbacks.MYD
mysql/my_wiki/wikicryptopp_externallinks.MYD
mysql/my_wiki/wikicryptopp_uploadstash.frm
mysql/my_wiki/wikilounge_user_newtalk.MYD
mysql/my_wiki/wikicryptopp_job.MYI
mysql/my_wiki/wikicryptopp_user_newtalk.MYI
mysql/my_wiki/wikicryptopp_page.MYI
mysql/my_wiki/wikilounge_filearchive.MYD
mysql/my_wiki/wikilounge_user.frm
mysql/my_wiki/wikicryptopp_oldimage.MYD
mysql/my_wiki/wikicryptopp_text.MYI
mysql/my_wiki/wikicryptopp_categorylinks.frm
mysql/my_wiki/wikilounge_externallinks.frm
mysql/my_wiki/wikilounge_smw_relations.frm
mysql/my_wiki/wikilounge_user_groups.MYI
mysql/my_wiki/wikilounge_querycache_info.MYD
mysql/my_wiki/wikicryptopp_pagelinks.MYI
mysql/my_wiki/wikilounge_archive.MYD
mysql/my_wiki/wikicryptopp_searchindex.MYD
mysql/my_wiki/wikilounge_hitcounter.frm
mysql/my_wiki/wikicryptopp_langlinks.MYD
mysql/my_wiki/wikicryptopp_watchlist.MYD
mysql/my_wiki/wikilounge_querycache.frm
mysql/my_wiki/wikicryptopp_recentchanges.MYI
mysql/my_wiki/wikilounge_searchindex.MYI
mysql/my_wiki/wikicryptopp_tag_summary.frm
mysql/my_wiki/wikicryptopp_l10n_cache.frm
mysql/my_wiki/wikilounge_job.MYI
mysql/my_wiki/wikilounge_user.MYI
mysql/my_wiki/wikilounge_page.MYD
mysql/my_wiki/wikicryptopp_user_properties.frm
mysql/my_wiki/wikilounge_templatelinks.MYI
mysql/my_wiki/wikilounge_externallinks.MYD
mysql/my_wiki/wikilounge_logging.MYD
mysql/my_wiki/wikilounge_math.MYD
mysql/my_wiki/wikilounge_ipblocks.MYD
mysql/my_wiki/wikilounge_oldimage.MYI
mysql/my_wiki/wikicryptopp_logging.MYI
mysql/my_wiki/wikicryptopp_ipblocks.MYD
mysql/my_wiki/wikicryptopp_archive.MYI
mysql/my_wiki/wikicryptopp_logging.MYD
mysql/my_wiki/wikicryptopp_oldimage.frm
mysql/my_wiki/wikicryptopp_image.MYD
mysql/my_wiki/wikicryptopp_recentchanges.frm
mysql/performance_schema/
mysql/performance_schema/file_summary_by_event_name.frm
mysql/performance_schema/cond_instances.frm
mysql/performance_schema/setup_consumers.frm
mysql/performance_schema/events_waits_summary_global_by_event_name.frm
mysql/performance_schema/mutex_instances.frm
mysql/performance_schema/setup_timers.frm
mysql/performance_schema/db.opt
mysql/performance_schema/events_waits_current.frm
mysql/performance_schema/events_waits_history.frm
mysql/performance_schema/performance_timers.frm
mysql/performance_schema/threads.frm
mysql/performance_schema/file_summary_by_instance.frm
mysql/performance_schema/events_waits_summary_by_thread_by_event_name.frm
mysql/performance_schema/setup_instruments.frm
mysql/performance_schema/file_instances.frm
mysql/performance_schema/rwlock_instances.frm
mysql/performance_schema/events_waits_history_long.frm
mysql/performance_schema/events_waits_summary_by_instance.frm
mysql/aria_log.00000001
mysql/ib_logfile1
mysql/ibdata1
mysql/aria_log_control
tar: Exiting with failure status due to previous errors
#
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
asked Jul 29, 2010 at 7:17
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.
answered Jul 29, 2010 at 11:22
KeithBKeithB
9,7862 gold badges22 silver badges16 bronze badges
3
The problem is the f argument. It takes the next value as the filename, so it must be the last argument:
tar cvzf output.tgz folder
or:
tar -cvzf output.tgz folder
These are both the same and don’t produce an error.
![]()
Worthwelle
4,41811 gold badges19 silver badges31 bronze badges
answered Jan 28, 2013 at 9:21
1
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 …
answered Jan 17, 2014 at 12:24
0
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.
answered Oct 10, 2016 at 15:03
DomainsFeaturedDomainsFeatured
1891 gold badge2 silver badges9 bronze badges
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.
Tak
2832 silver badges5 bronze badges
answered Sep 10, 2011 at 23:06
4
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.
Jamie Taylor
1,3313 gold badges17 silver badges27 bronze badges
answered Oct 19, 2013 at 7:52
1
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
answered Jul 29, 2010 at 7:26
![]()
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.
answered Apr 23, 2019 at 18:33
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
asked Jul 29, 2010 at 7:17
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.
answered Jul 29, 2010 at 11:22
KeithBKeithB
9,7862 gold badges22 silver badges16 bronze badges
3
The problem is the f argument. It takes the next value as the filename, so it must be the last argument:
tar cvzf output.tgz folder
or:
tar -cvzf output.tgz folder
These are both the same and don’t produce an error.
![]()
Worthwelle
4,41811 gold badges19 silver badges31 bronze badges
answered Jan 28, 2013 at 9:21
1
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 …
answered Jan 17, 2014 at 12:24
0
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.
answered Oct 10, 2016 at 15:03
DomainsFeaturedDomainsFeatured
1891 gold badge2 silver badges9 bronze badges
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.
Tak
2832 silver badges5 bronze badges
answered Sep 10, 2011 at 23:06
4
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.
Jamie Taylor
1,3313 gold badges17 silver badges27 bronze badges
answered Oct 19, 2013 at 7:52
1
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
answered Jul 29, 2010 at 7:26
![]()
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.
answered Apr 23, 2019 at 18:33
Я написал небольшой скрипт, который копирует и сжимает список каталогов + файлов.
Сценарий, по-видимому, успешно выполняется, поскольку после запуска сценария создается полезный файл .tar.gz.
Тем не менее, я получаю это надоедливое сообщение после завершения скрипта:
tar: выход с состоянием ошибки из-за предыдущих ошибок
Я не вижу никаких сообщений об ошибках во время работы скрипта, и, как я уже сказал, созданный файл может быть распакован без предупреждений / ошибок. Поскольку я использую это как часть своей резервной копии, я хочу убедиться, что я не игнорирую что-то серьезное.
Каковы возможные причины появления этого сообщения об ошибке / предупреждения, и могу ли я смело его игнорировать? Если я не могу игнорировать это, каковы шаги для диагностики и устранения ошибки?
Я работаю на Ubuntu 10.0.4
Вы получите это сообщение, если по какой-либо причине tar не сможет добавить все указанные файлы в tar. Один из наиболее распространенных — отсутствие разрешения на чтение одного из файлов. Это может быть большой проблемой, так как вы используете это для резервного копирования. Если вы используете флаг -v , попробуйте отключить его. Это должно уменьшить выход и позволить вам увидеть, что происходит.
проблема в аргументе, в качестве аргумента f аргумент f принимает имя файла, поэтому он должен быть последним аргументом
tar cvzf output.tgz folder
или же
tar -cvzf output.tgz folder
то же самое и не принимать ошибку.
ответ дан Andrea Monni201
Иногда при резервном копировании файлов, которые могут изменяться во время резервного копирования, таких как файлы журналов, вам может быть полезен параметр tar ‘—ignore-failed-read’ (я работаю в Debian Linux, не уверен, что он не относится к gnu tar).
Стандартный вывод и ошибка могут быть перенаправлены в 2 разных файла что-то вроде:
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
Я считаю, что это в целом безопасно, но, пожалуйста, будьте осторожны, поскольку tar не остановится …
ответ дан Fabio Pedrazzoli61
У меня возникла та же проблема, и ни один из приведенных выше ответов не помог мне. Однако я обнаружил, что работает следующая команда:
tar -cpzf /backups/fullbackup.tar.gz --exclude=backups --exclude=proc --exclude=tmp --exclude=mnt --exclude=sys --exclude=dev --exclude=run /
Ошибки, на которые ссылались в tar: Exiting with failure status due to previous errors можно определить, отключив опцию -v. После проверки ошибки пришли из каталогов вроде /run и /sys .
Исключая эти каталоги, он работает просто отлично. Надеюсь, что это поможет любому с подобной проблемой.
ответ дан DomainsFeatured149
У меня такая же проблема. Все, что я сделал, это удалил черту («-«) из команды.
Вместо того, чтобы печатать как
tar -cvfz output.tar.gz folder/
попробуйте ввести это как
папка tar cvfz output.tar.gz /
Я не знаю, почему черта вызывала проблемы в моем случае, но по крайней мере это работало.
Вы неправильно поняли предыдущий ответ. Проблема не в - , это где f находится в вашем списке аргументов.
tar cvfz target.tgz <files>
Постараюсь создать архив с именем «z», так как это текст после f . Сообщение об ошибке вызвано тем, что tar не может найти «target.gz» для добавления в архив «z».
tar cvzf target.tgz <files>
Будет правильно создавать target.tgz и добавлять в него файлы. Это потому, что target.tgz является первым текстом после аргумента f .
Обычно вы можете игнорировать это сообщение. Если есть какие-либо изменения (например, удаление / создание / изменение файлов) в базовом дереве каталогов во время создания tar, он выдаст это сообщение. Также, если есть специальные файлы, такие как узлы устройств, fifos и т.д., Они вызовут это предупреждение.
Вы уверены, что не видите никаких файлов преступников? Попробуйте с помощью tar cvfz yourtarball.tgz /your/path
ответ дан Janne Pikkarainen6k