unixtarmountsolaris-10

tar command not processing


I want to restore previous backuped directory (spect folder into /opt)

Architecture (Solaris 10) :

root@sms01sxdg /opt> ls -ltr
total 22
[...]
drwxr-xr-x   2 specadm  nms         1024 Dec 24 13:40 spect
root@sms01sxdg /opt>
root@sms01sxdg /opt> df -kh
Filesystem             size   used  avail capacity  Mounted on
/dev/md/dsk/d0         9.8G   4.2G   5.6G    43%    /
[...]
/dev/md/dsk/d30        7.9G    94M   7.7G     2%    /opt/spect
root@sms01sxdg /opt>

I have previously backuped folder with tar command : tar cvf spect.tar spect. It has worked successfully and when I launch tar -tf spect.tar it shows the sub-folders/files into.

When I try to restore backup, it doesn't work or more precisely, it returns nothing and files are finally not extracted.

root@sms01sxdg /opt> tar -xvf /export/specbackup_db/spect.tar .
root@sms01sxdg /opt> ls -l spect/
total 0
root@sms01sxdg /opt>

I suspect that the folder I have backup is a mount point and it is the cause of this problem.

But it seems the mount point is still mounted. I have always performed this kind of command but it is the first time I encounter this kind.


Solution

  • Try again after removing the dot at the end of the command. Generally, you can specify the files that should be extracted from the tar by listing their paths after the tar file name ex: tar -xvf tarfile.tar file1 file2. this will extract only file1 and file2 from the tarfile.tar.