Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
i want to delete the logfiles older than 30 days
how to do this? in Qliksense server
this is the path saving the logs in server : C:\QlikShare\ArchivedLogs
this folder logs i need to delete monthly once .
Hi,
you can follow the solution provided by Robert sveback on this thread and tell us ![]()
Hi,
you can follow the solution provided by Robert sveback on this thread and tell us ![]()
Thanks youssefbelloum let me try it and come back to you ![]()
thanks Yousuf,
we have created a powershell code and ran the window scheduler and working fyn
You're welcome chanty ![]()
Good luck
//In Load editor create below procedure and call with Pathname, older days
Sub DeleteOldFiles (vPath,vNoOfDaysToKeep)
//Move file from C:\TestLog to C:\Logs\NPrintLog
// LET MoveCmd = 'MOVE $(vPath)"\*.*" "C:\Logs\NPrintLog\"';
//Copy files from C:\TestLog to C:\Logs\NPrintLog
LET MoveCmd = 'COPY $(vPath)"\*.*" "C:\Logs\NPrintLog\"';
execute cmd.exe /c "$(MoveCmd)" ;
//Delete older 30 days files from C:\APPL Qlik\TestLog
LET DelCmd = 'forfiles /p $(vPath) /s /m *.* /d -$(vNoOfDaysToKeep) /c "cmd /c del @file"';
execute cmd.exe /c "$(DelCmd)" ;
End Sub;
Call DeleteOldFiles ('"C:\TestLog"',30);
---------------------------------------------------------------------------------------------------------------------
**Syntax Details
/p Path The Path to search (default=current folder)
/m SrchMask Select files matching the specified search mask
default = *.*
/s Recurse into sub-folders
/c command The command to execute for each file.
/d date Select files with a last modified date greater than or
equal to (+), or less than or equal to (-),
the specified date, using the region specific date format
typically "MM/DD/yyyy" or "DD/MM/yyyy"
**