How are they different? I get duplicate entries with either. I would expect from reading the man page that -r would append files no matter what so dupicates to be expected. But -u should only add the new file if it is di
From man page of tar
Code:
cweimann@hp800g3:~ $ tar cf test.tar test1.txt
cweimann@hp800g3:~ $ tar -u -f test.tar test2.txt
cweimann@hp800g3:~ $ tar -u -f test.tar test2.txt
cweimann@hp800g3:~ $ tar -u -f test.tar test2.txt
cweimann@hp800g3:~ $ tar tvf test.tar
-rw-r--r-- 0 cweimann cweimann 2 Sep 13 21:11 test1.txt
-rw-r--r-- 0 cweimann cweimann 11 Sep 13 21:12 test2.txt
-rw-r--r-- 0 cweimann cweimann 11 Sep 13 21:12 test2.txt
-rw-r--r-- 0 cweimann cweimann 11 Sep 13 21:12 test2.txt
cweimann@hp800g3:~ $
From man page of tar
Code:
-u Like -r, but new entries are added only if they have a
modification date newer than the corresponding entry in the
archive. Note that this only works on uncompressed archives
stored in regular files. The -f option is required. The long
form is --update.
Last edited by a moderator: