Log files not rotating or compressing


Thanks for this so far, much better than the vb script!

Started using since the pre ini version, emails worked through gmail.
Now with the ini version, emails are not sent and I have no error message in the log.
I do remember in your interim ini version, emails didn't work at all because for example it was looking for gmailuid, when the ini specified smtpuid.

Above resolved by user configuration.

Also, zip not working due to file open.
Closed Feb 4, 2013 at 10:43 PM by lrissman


robnitro wrote Jan 29, 2013 at 8:57 PM

Never mind, I had 2 settings in the ini file uncommented... doh!
Thanks for this script. BTW, is there a way to get rid of the ex: 95% 234,000mb 190MB/s status updates in the log?

lrissman wrote Jan 31, 2013 at 3:59 PM

Hi, Happy you managed to solve the issue and glad that somebody else is enjoying the script.

Not sure which messages you are asking about. Can you provide an example? And generally speaking, yes anything is possible with powershell. ;-)

robnitro wrote Jan 31, 2013 at 8:10 PM

For example this is in the log from the snapraid sync... I used to have output in batch go to a txt, same thing happened....

17%, 68193 MiB, 198 MiB/s, 0:26 ETA
17%, 68375 MiB, 198 MiB/s, 0:26 ETA
..... and so on

Also, the new ini script isn't saving to the zip files anymore...
Transcript started, output file is W:\1snapRAIDLOGS\SnapRAID.log
Write-zip : The process cannot access the file 'W:\1snapRAIDLOGS\SnapRAID.log' 
because it is being used by another process.
At C:\SnapRAID\snapraid-helper.ps1:297 char:5
+     Write-zip "$LogFile" -level 9
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (W:\1snapRAIDLOGS\SnapRAID.log:Str 
   ing) [Write-Zip], IOException
    + FullyQualifiedErrorId : FileError,Pscx.Commands.IO.Compression.WriteZipC 
Rename-Item : Cannot rename because item at 
'W:\1snapRAIDLOGS\SnapRAID.log.zip' does not exist.
At C:\SnapRAID\snapraid-helper.ps1:298 char:5
+     Rename-Item "$LogFile.zip" "$LogFile.1.zip"
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [Rename-Item], PSInvalidOp 
    + FullyQualifiedErrorId : InvalidOperation,Microsoft.PowerShell.Commands.R 
Remove-Item : Cannot remove item W:\1snapRAIDLOGS\SnapRAID.log: The process 
cannot access the file 'W:\1snapRAIDLOGS\SnapRAID.log' because it is being 
used by another process.
At C:\SnapRAID\snapraid-helper.ps1:299 char:5
+     Remove-Item "$LogFile"
+     ~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (W:\1snapRAIDLOGS\SnapRAID.log:FileI 
   nfo) [Remove-Item], IOException
    + FullyQualifiedErrorId : RemoveFileSystemItemIOError,Microsoft.PowerShell 
New-Item : The file 'W:\1snapRAIDLOGS\SnapRAID.log' already exists.
At C:\SnapRAID\snapraid-helper.ps1:300 char:5
+     New-Item "$LogFile" -type file
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (W:\1snapRAIDLOGS\SnapRAID.log:Strin 
   g) [New-Item], IOException
    + FullyQualifiedErrorId : NewItemIOError,Microsoft.PowerShell.Commands.New 

lrissman wrote Feb 4, 2013 at 9:38 PM

The zip bit I'll dig into. I ran into that before -- the powershell transcript feature tends to hold files open. I must have re-introduced the bug when I moved to the ini version.

As to the reporting granularity. I am working on a module now (version update) that will allow you to choose exactly what gets reported and what doesn't per type (email/log).

i'd also like to figure out a way to check if there is a running console somewhere (Eg, RDP console session) and launch a gui-based tail app like snaketail to show the progress during the sync.

lrissman wrote Feb 4, 2013 at 10:43 PM

Fixed the file open issue on the rotate logs in the latest commit: http://snapraidhelperwin.codeplex.com/SourceControl/changeset/78adf0cff483

For the notification bit see: http://snapraidhelperwin.codeplex.com/workitem/2

Thanks for reporting the issue.