Category: IIS


Log Compress with 7Zip

Here is the quick script to compress *.log file with 7zip.

 

You may want to change PATH and DAYS (which is 45 here) and create schedule task for it.

@echo off
setlocal EnableExtensions DisableDelayedExpansion

rem // Define constants here:
set “_ROOT=C:\Path\W3SVC1”
set “_PATTERN=*.log”
set “_LIST=%TEMP%\%~n0.tmp”
set “_ARCHIVER=%ProgramFiles%\7-Zip\7z.exe”

rem // Get current date in locale-independent format:
for /F “tokens=2 delims==” %%D in (‘wmic OS get LocalDateTime /VALUE’) do set “TDATE=%%D”
set “TDATE=%TDATE:~,8%”

rem // Create a list file containing all files to move to the archive:
> “%_LIST%” (
for /F “delims=” %%F in (‘
forfiles /S /P “%_ROOT%” /M “%_PATTERN%” /D -45 /C “cmd /C echo @path”
‘) do echo(%%~F
) && (
rem // Archive all listed files at once and delete the processed files finally:
“%_ARCHIVER%” a -sdel “%_ROOT%_%TDATE%.zip” @”%_LIST%”
rem // Delete the list file:
del “%_LIST%”
)

endlocal
exit /B

Merhaba,

Server 2008 R2’da gelen aşağıdaki hatanın çözümü için “Net TCP Port Sharing” servisini restart etmek yeterli oldu.Neden başladığı daha detaylı kalıcı çözüm bulunca yazacağım.

An error occurred while dispatching a duplicated socket: this handle is now leaked in the process.

ID: 1096

Source: System.ServiceModel.Activation.TcpWorkerProcess/50468166

Exception: System.ServiceModel.FaultException: The client was unable to process the callback request due to an internal error. For more information about the error, either turn on IncludeExceptionDetailInFaults (either from CallbackBehaviorAttribute or from the <clientDebug> configuration behavior) on the client in order to send the exception information back to the server, or turn on tracing as per the Microsoft .NET Framework SDK documentation and inspect the client trace logs.

 

Server stack trace:

at System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(Message reply, MessageFault fault, String action, MessageVersion version, FaultConverter faultConverter)

at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)

at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result)

at System.ServiceModel.Channels.ServiceChannelProxy.InvokeEndService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)

at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

 

Exception rethrown at [0]:

at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)

at System.ServiceModel.Activation.WorkerProcess.EndDispatchSession(IAsyncResult result)

Process Name: SMSvcHost

Process ID: 3880

 

İyi Günler,

IIS 7.5 FTP Sorunu

Merhaba,

Problem:Server 2008 R2 üzerinde IIS 7.5 da FTP server’a lokal FW açık iken bağlantı kurulamaması.

Yapılanlar:FW’da 21 nolu TCP portuna allow verilmesi.Farklı bir server’dan telnet ile server a erişilebilmesi ama “directory listing” yapılamaması!Durumum Serverda “Connection Chanel” ın çalışması ama TCP 20 “Data Channel” ın çalışmamasına da bağlanabiliyor.

Çözüm:CMD “Run As Admin” ile

sc sidtype ftpsvc unrestricted

komutunun çalıştırılmasından sonra;

net stop ftpsvc & net start ftpsvc

Bu işlemlerden sonra FW devrede iken de FTP bağlantısı sağlanabiliyor.