Tar complains.......

That there is 'no such file or directory'?!?!?!?!?

I am using tar to save at directory level, yet the error I am getting refers to a file within this directory:

tar: /apps/hiport/spool/ctree/L0000821.FCS: No such file or directory

(the bit in bold is the directory that was in the tar -cf command)

Does tar catalog the directory prior to saving thus felt that this file should have existed, or could it be possible for someone to have deleted this file whilst it was being saved?

So did you check if the file "/apps/hiport/spool/ctree/L0000821.FCS" still exists..?

Sorry, should have explained...

The file no longer existed.

Well difficult to tell exactly what happened..from the description.But to avoid such scenarios, you can get a list of , what all has been included in the tar file. Following piece of code might help..

# Get full list of sub-directories and files in tar file
print
print "Determining list of files archived -- this may take 3-4 minutes. Process starting . . ."
cat $TARFILE | /usr/contrib/bin/gunzip | tar -tVf - >$LISTFILE
print " . . . Listing now complete."
num_files_in_tar=$(cat $LISTFILE | wc -l)
num_directory_files_in_tar=$(cat $LISTFILE | grep ^d | wc -l)
num_link_files_in_tar=$(cat $LISTFILE | grep ^l | wc -l)
num_ordinary_files_in_tar=$(cat $LISTFILE | grep ^- | wc -l)
num_block_files_in_tar=$(cat $LISTFILE | grep ^b | wc -l)
num_character_files_in_tar=$(cat $LISTFILE | grep ^c | wc -l)
num_network_files_in_tar=$(cat $LISTFILE | grep ^n | wc -l)
num_fifo_files_in_tar=$(cat $LISTFILE | grep ^p | wc -l)
num_socket_files_in_tar=$(cat $LISTFILE | grep ^s | wc -l)
let num_other_files_in_tar=num_ordinary_files_in_tar+num_block_files_in_tar+num_character_files_in_tar+num_network_files_in_tar+num_fifo_files_in_tar+num_socket_files_in_tar

where :
TARFILE : Name of your tar file.
LISTFILE : Name of the file which would be used for listing.

LISTFILE=/path_name/archive_lst_$(date +%Y%m%d_%H%M)

Hope this helps..

Thanks!
nua7