Newbie: star exit codes

prasad jlv <[email protected]> Sat, 10 Dec 2005 09:27:23 -0800 (PST)
Newsgroups gmane.comp.archivers.star.user
Message-ID <[email protected]>
I am trying to develop a simple key files backup  script using star and I have RTFM but I have a few questions about exit  codes from star. I need to able to capture actual errors and ignore  warnings. Let's say I want the script to fail for anything other than 0  exit code.
  
  Here's what I am trying to do 
  (a very simple example):
  
  Let's assume that I wish to backup the following directory:
  bash-3.00# find . -ls
  13642    1 drwxr-xr-x   3  root      other         512 Dec  9  13:22 .
  13643    1 drwxr-xr-x   2  root      other         512 Dec  9  21:18 ./dir1
  13644    1 -rw-r--r--   1  root      other          14  Dec  9 21:17 ./dir1/file1
  13661    1 -rw-r--r--   1  root      other          14  Dec  9 21:18 ./dir1/file2
  13645    1 lrwxrwxrwx   1  root      other           4  Dec  9 13:21 ./dir2 -> dir1
  13646    1 lrwxrwxrwx   1  root      other           4  Dec  9 13:22 ./dir3 -> dir2
  
  So I do this:
  bash-3.00# star -c . f=../star_test.star 
  star: 1 blocks + 0 bytes (total of 10240 bytes = 10.00k).
  
  and I verify that everything looks good:
  bash-3.00# star -tv f=../star_test.star 
        0 drwxr-xr-x  root/other Dec  9 13:22 2005 ./
        0 drwxr-xr-x  root/other Dec  9 21:18 2005 dir1/
       14 -rw-r--r--  root/other Dec  9 21:17 2005 dir1/file1
       14 -rw-r--r--  root/other Dec  9 21:18 2005 dir1/file2
        0 lrwxrwxrwx  root/other Dec  9 13:21 2005 dir2 -> dir1
        0 lrwxrwxrwx  root/other Dec  9 13:22 2005 dir3 -> dir2
  star: 1 blocks + 0 bytes (total of 10240 bytes = 10.00k).
  
  Then I have added some files : 
  bash-3.00# touch dir1/file3
  bash-3.00# touch dir1/file4
  
  and then after a few days I want to restore my original files, so I do this:
  bash-3.00# star -xUp f=../star_test.star   
  star: File 'dir2' not removed.
  star: File exists. Cannot create symbolic link 'dir2' to 'dir1'.
  star: File 'dir3' not removed.
  star: File exists. Cannot create symbolic link 'dir3' to 'dir2'.
  star: 1 blocks + 0 bytes (total of 10240 bytes = 10.00k).
  star: The following problems occurred during archive processing:
  star: Cannot: stat 0, open 2, read/write 0. Size changed 0.
  star: Missing links 0, Name too long 0, File too big 0, Not dumped 0.
  star: Processed all possible files, despite earlier errors.
  bash-3.00# echo $?
  254
  
  Does -U apply to directories too i.e. unconditionally overwrite? Why is  star trying to remove the directory? Writing errors to a file, parsing  it and ignoring known warns/errors is not an option right now. Am I  missing an option? I have tried -xdir but that does not help. Maybe I  am doing it completely wrong?
  
  
  Thank you in advance for all the help.
  -- pj
  
  
  

			
---------------------------------
Yahoo! Shopping
 Find Great Deals on Holiday Gifts at Yahoo! Shopping