Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a batch file that runs nightly to compress some PST's, it uses 7zip & generally is pretty successful.

However it tends to create left-over .tmp files (9 over 2 days), I want to delete these. According to multiple 7zip forums, patch requests, & other websites I can change the directory it stores those, but nothing more. I speculate this shouldn't be happening & something is wrong, furthermore occasionally it has skipped files. I want to keep a log, even if everything is fine, its a good fall back if something goes funky.

My batch file has a separate line/command for each PST: 7z.exe u -t7z JENNIFER.7z JENNIFER.PST -r. I have successfully gotten a log when I append " >7zip.log". However when I do that for two different lines/commands only the last one is logged, thus I assume its being overwritten.

Short of making one long complex command (as I have PST over 2GB's among other files in that folder that I don't want compressed); does anyone have any other ideas/thoughts

Side note: Now that I think about it my backup agent might be interrupting access to .7z files, thus causing all this. However oddly enough the batch file is a 'windows scheduled task' & it ran with result 0x0 (which if I remember right is success) & backup was also successful. Either way I'd like to learn how to properly log with 7zip & feedback on why .tmp files may be left over from a compression command

share|improve this question
up vote 1 down vote accepted

Most backup program does not lock file. Antivirus may lock the file for checking and keep it from being delete. So you can disable anti virus first.

share|improve this answer

I was doing redirections wrong (found some additional info). Issue hasn't happened in awhile, but now that I am redirecting err & stdout & appending to a file, I get all info I need to probably troubleshoot. I am considering this a one-off & closing

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.