1

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

3 Answers 3

1

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.

2

Use ">>7zip.log" instead of ">7zip.log", this will make the output to be appended to the text file, and not overwrite the previous one.

1
  • This answer isn't very useful -- given that Gregg has already mentioned that he was appending to file in his own answer. Commented Sep 1, 2016 at 10:33
0

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .