In order for tar to set ownership and permissions of higher-level
directories on extraction, there has to be a record of their ownership
and permissions in the tar archive. In the first case it was there
(because you archived everything below ./export/home/user1); in the
second case it was not, because the _only_ thing recorded in the tar
archive was the details of that one file.
To do what you want, you need to create a tar archive that has
records for ./export/home/user1, ./export/home/user1/.ssh and
./export/home/user1/.ssh/authorized_keys, but I don't think Sun tar
has any way to archive a directory without also archiving the files
below it.
Solution: use pax (with -d option) to create the archive instead.
pax -w -d -x ustar ./export/home/user1 ./export/home/user1/.ssh \
./export/home/user1/.ssh/authorized_keys > backup.tar
--
Geoff Clare <
net...@gclare.org.uk>