Is it possible to use 'tar' to only create an archive with directories - no files belonging to these dirs.? I basically only want to save the dir. structure without the files.
You are right. The problem is that Solaris (I don't know why) append a / when you use tar on the root directory.
ex. tar -cvf /tmp/root.tar /
a //var
a //var/spool
ecc.
try to use relative path:
cd /
find . -type f > file_list.txt
tar -cvfpX /dir_with_free_space/dir.tar file_list.txt -C / .
52000 entries isn't a problem, i tried with 170000 entries.
But....if you have to save root directory tree you have to exclude also special files and link, so add this find in your script:
find . -type b >> file_list.txt
find . -type c >> file_list.txt
find . -type D >> file_list.txt
find . -type l >> file_list.txt
find . -type p >> file_list.txt
find . -type s >> file_list.txt
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.