I have a tar file which contain different versions of the same file, how can I extract one of the previous version of the file (not the last version) ?
here is how to create a test tar file:
create a test directory
tal@backup:~/tmp$ mkdir test
create a test file
tal@backup:~/tmp$ echo line 1 > test/test.txt
create the tar file which contains the test file
tal@backup:~/tmp$ tar -cvf test.tar test/*
returns
test/test.txt
check for changes
tal@backup:~/tmp$ tar -dvf test.tar test/*
returns (nothing yet)
test/test.txt
change the test file
tal@backup:~/tmp$ echo line 2 >> test/test.txt
check for changes
tal@backup:~/tmp$ tar -dvf test.tar test/*
returns (magic: the file has changed)
test/test.txt
test/test.txt: Mod time differs
test/test.txt: Size differs
update the tar file
tal@backup:~/tmp$ tar -uvf test.tar test/*
returns
test/test.txt
check for changes
tal@backup:~/tmp$ tar -dvf test.tar test/*
returns (both versions exist)
test/test.txt
test/test.txt: Mod time differs
test/test.txt: Size differs
test/test.txt
Thanks, Tal