Your message dated Sat, 12 Nov 2011 11:06:49 -0700
with message-id <[email protected]>
and subject line fixed
has caused the Debian Bug report #180553,
regarding tar: bug with --listed_incremental and --files-from
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
180553: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=180553
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: tar
Version: 1.13.25-2
Severity: wishlist
Tags: patch
When doing incremental backups with tar I get weird behavoir.
I'm using the following command line:
/tar --create --listed-incremental=files_incr --create --file /tmp/test.tar \
--files-from files_to_do
files_to_do contains:
/var/www
common.h
When I run this for the first time I get a full dump. This is ok.
When I run it for the second time, the files in /var/www are not dumped. This is
also ok. The file common.h is _always_ dumped. That is clearly not right.
I think i've traced this back to:
dump_file in create.c line: 941
if ((0 < top_level || !incremental_option)
&& !S_ISDIR (current_stat.st_mode)
&& current_stat.st_mtime < newer_mtime_option
&& (!after_date_option || current_stat.st_ctime <
newer_ctime_option))
when I print the values in this if (when using the above tar command) i get:
top_level -1
listed_incremental files_incr
incremental_option 1
after_date_option 1
newer_mtime_option 1043916483
newer_ctime_option 1043916483, newer_ctime_option is defined to be the same
as newer_mtime_option
if I enter these values in the if statement:
not_a_dir = !S_ISDIR (current_stat.st_mode)
current_xtime = current [cm] time of the file tar is watching
if ( ( 0 < -1 || ! 1 )
&& not_a_dir
&& current_mtime < 1043916483
&& ( ! 1 || current_ctime < 1043916483 ) )
The first part of the if yields
if ( ( false or false ) ... -> false
So when doing incremental backups this test will always fail and the rest is not
executed thereby always backing up files named on the command line.
The following patch fixes this: (against 1.13.25)
--- tar-1.13.25-orig/src/create.c Sat Feb 1 18:17:29 2003
+++ tar-1.13.25/src/create.c Fri Jan 31 15:46:28 2003
@@ -938,7 +938,7 @@
/* See if we want only new files, and check if this one is too old to
put in the archive. */
- if ((0 < top_level || !incremental_option)
+ if ((0 != top_level || !incremental_option)
&& !S_ISDIR (current_stat.st_mode)
&& current_stat.st_mtime < newer_mtime_option
&& (!after_date_option || current_stat.st_ctime <
newer_ctime_option))
-- System Information
Debian Release: 3.0
Architecture: i386
Kernel: Linux elektron 2.4.21-pre4 #14 Thu Jan 30 11:19:31 CET 2003 i686
Locale: LANG=en_US, LC_CTYPE=en_US
Versions of packages tar depends on:
ii libc6 2.3.1-3 GNU C Library: Shared libraries an
--- End Message ---
--- Begin Message ---
This bug is no longer present in modern versions of tar.
Bdale
pgpzZFK22JwgT.pgp
Description: PGP signature
--- End Message ---