Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

tar question

Status
Not open for further replies.

rtnMichael

Programmer
Aug 5, 2002
152
US
hey, I don't know if this is the place to ask, but I want to tar a directory full of certain files, but not move any of them around to other directories in the process. The thing is, I'll be running it on a cron once every day and place the .tar file in the same directory. Is it possible that tar can skip that particular file when it runs again?

Thanks
M
 
cool, thanks...now is it possible to remove a file once it has been tared, while tar is running?
 
It is possible, but not a good idea. If you are putting the files on a floppy or tape there is a chance you could get an I-O error before the tar is done. It would be better to use the mv command to put the file in /tmp or somewhere else if you need to get rid of it as fast as possible. Then remove the file from /tmp at the end of the process.
 
ok, cool, now what can I do to know the tar worked fine. I'm going to run this on a cron, and I won't be watching it, so other than going into the directory and manually looking at the file, what kind of returns will tar give me telling me the tar worked fine or there was a problem?
 
I just noticed the tar command above was to extract files from a tape not copy to tape. Make the command
tar -cvf . If you add 2>/tmp/tarerr (or some filename) to the end of the command you should have an empty file if no errors, or something in the file if there are errors.
 
so tar does return errors if not done correctly? The 2>/tmp/tarerr is just printing out to stderr, right? Just sending it out to a logfile? If that's the case, then this should be easy. Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top