Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Chanty4u
MVP
MVP

RE: Delete Older logs

Hi All,

ogster1974

youssefbelloum

omarbensalem

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 .

1 Solution

Accepted Solutions
YoussefBelloum
Champion
Champion

Hi,

you can follow the solution provided by Robert sveback on this thread and tell us

Re: Sense: 5Gig of logs in: ProgramData\Qlik\Sense\Log

View solution in original post

5 Replies
YoussefBelloum
Champion
Champion

Hi,

you can follow the solution provided by Robert sveback on this thread and tell us

Re: Sense: 5Gig of logs in: ProgramData\Qlik\Sense\Log

Chanty4u
MVP
MVP
Author

Thanks youssefbelloum‌ let me try it and come back to you 

Chanty4u
MVP
MVP
Author

thanks Yousuf,

we have created a powershell code and ran the window scheduler  and working fyn

YoussefBelloum
Champion
Champion

You're welcome chanty

Good luck

ManimekalaiS
Partner - Contributor
Partner - Contributor

//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"

 

 

 

**