[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug: --listed_incremental and --files-from
From: |
Miek Gieben |
Subject: |
bug: --listed_incremental and --files-from |
Date: |
Thu, 30 Jan 2003 14:05:02 +0100 |
User-agent: |
Vim/Mutt/Linux |
Hi,
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
I'm running this from tar's src/ directory. 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 traces 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 yield
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.
I'm not totally sure, but I think that it should not be:
if ((0 < top_level || !incremental_option)
BUT
if ((0 > top_level || !incremental_option)
This way incremental backup work as expected.
regards,
Miek
PS Please CC me as a'm not no the list
PPS thanks to Stepan Kasal for help on this subject
--
:wq!
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- bug: --listed_incremental and --files-from,
Miek Gieben <=