View Single Post
  #1 (permalink)  
Old 06-15-2008, 06:00 AM
Philipp Ghirardini
Tablet PC Guest
 
Posts: n/a
tar --remove-files

hi!

I have the following problem:

I want to pack all files in a special directory except some particular
ones and delete them afterwards. The files shall be in the archive
without subdirectories.

I have the following tar command:

tar --remove-files -C /net_tests/tests/dir_one -czf
/net_tests/tests/dir_one/myzip.tar.gz . --exclude=file3
--exclude=myzip.tar.gz


Actually it does exactly what I want but it returns 2 and not 0 because
of the following reason:

tar: .: Cannot rmdir: Invalid argument
tar: Error exit delayed from previous errors


I think the problem is that the command is packing the '.' and so it is
trying to remove it what fails of course.
I also creates a subdirectory '.' in the archive. Actually it doesn't
matter because when unpacking the archive that has no effect.

The problem is that I need the return value to check if the action was
successful.

Has anyone an idea?

kind regards

Philipp

Reply With Quote

 
Old 06-15-2008, 06:00 AM
Xploder HD Movie Player for PS3. Manage, convert and transfer media files between the PC and PS3.