Refresh private logs every month

All questions related to installations, configurations and maintenance of Advanced Host Monitor (including additional tools such as RMA for Windows, RMA Manager, Web Servie, RCC).
Post Reply
vidyagana
Posts: 106
Joined: Fri Mar 25, 2005 10:35 am

Refresh private logs every month

Post by vidyagana »

Is there any way to refresh private logs during the first day of every month. My logs are just getting piled up from the day it was first configured.

Thanks.
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

Is there any way to refresh private logs during the first day of every month. My logs are just getting piled up from the day it was first configured.
What exactly means "refresh"? You want to remove old log? You want to move log to archive?
I think you should use "Special processing" options (located on "Log settings" page in the Options dialog)

Regards
Alex
vidyagana
Posts: 106
Joined: Fri Mar 25, 2005 10:35 am

Post by vidyagana »

Hi,

I just went through the special processing options for setting up private log. I have only two options - "If private log is bigger than", "If private log was created".
Now consider my situation, for eg on Jun 01, 2005 I want to move all May 2005 logs to c:\hostmonitor\May2005. Is there anyway that this can be done?

Thanks.
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

Sure.
Quote from the help system
Please note: 1 month ago doesn't mean exactly 1 month (30 or 31 days) ago. It means "previous" month. E.g. if log file was created in October (any day of the October), HostMonitor will execute specified command on November 1st.
Regards
Alex
vidyagana
Posts: 106
Joined: Fri Mar 25, 2005 10:35 am

Post by vidyagana »

Ok thats good. And also when I click the Check button for special processing of private logs it is expecting a command to execute. I want to do the following if the log is one month old.
1. Create a folder with previous month's name in the format MMYYYY.
2. Move 1 month old logs to that folder.

Is all this possible or should I already have the folder created and hostmonitor will automatically take care of moving the logs.

Thanks.
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

Quote from the manual
You may define command line for execution and choose one of 3 available options to specify when HostMonitor should execute external command for processing common log file(s):
It means HostMonitor will check parameters of log file(s) and execute specified command. HostMonitor will not move files unless you provide command line that moves files.
I want to do the following if the log is one month old.
1. Create a folder with previous month's name in the format MMYYYY.
2. Move 1 month old logs to that folder.
I think you may use %MMYYYY%.htm format for log file name (extension depends on type of the file you want to use, for example HTM). Than you may create simple BAT file like

Code: Select all

mkdir %2
cmd /c move /y %1 %3%2
Last step: provide command line to start BAT file, e.g.

Code: Select all

cmd /c path_to_bat_file "%log%" "%logname%" "%logpath%"
Regards
Alex
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

PS If you need such behavious for various private log files, its a little bigger problem.
Post Reply