The append option appends any given file to the archive. If a file already exists inside the archive, tar will append the file, and the archive will contain duplicates. The update option -u specifies only appending files that are newer than existing files inside the archive.
$ tar -tf archive.tar
filea
fileb
filec
To append filea only if filea has been modified since the last time it was added to archive.tar, use the following command:
$ tar -uf archive.tar filea
Nothing happens if the version of filea outside the archive and the filea inside archive.tar have the same timestamp.
Use the touch command to modify the file timestamp and then try the tar command again:
$ tar -uvvf archive.tar filea
-rw-r--r-- slynux/slynux 0 2010-08-14 17:53 filea
The file is appended since its timestamp is newer than the one inside the archive, as shown with the -t option:
$ tar -tf archive.tar
-rw-r--r-- slynux/slynux 0 2010-08-14 17:52 filea
-rw-r--r-- slynux/slynux 0 2010-08-14 17:52 fileb
-rw-r--r-- slynux/slynux 0 2010-08-14 17:52 filec
-rw-r--r-- slynux/slynux 0 2010-08-14 17:53 filea
Note that the new filea has been appended to the tar archive. When extracting this archive, tar will select the latest version of filea.