Date macro fails under specific circumstances

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
Arco
Posts: 2
Joined: Wed Jul 23, 2008 7:54 am

Date macro fails under specific circumstances

Post by Arco »

I have a file availability check as follows:
\\path\to\destination\filename%jjj[+162d]%.txt

This check fails when the the resulting number is higher than 366, i.e. it will detect the existence of this file:
\\path\to\destination\filename366.txt

but will not detect the existence of this file:
\\path\to\destination\filename367.txt

Using 7.42 beta (but this didn't work in previous versions either)
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

It works just like it suppose to work.
Quote from the manual
%jjj% - The day of the year as a three digit decimal number in the range of 001 to 366
Do you really think that calendar year may contain more than 366 days?
Probably you misunderstand how expressions like [+1d] work? HostMonitor does not add just number to another number. It calculates correct calendar date.

Regards
Alex
Arco
Posts: 2
Joined: Wed Jul 23, 2008 7:54 am

Post by Arco »

Thanks for your swift reply.

What i'm trying to do is the following: once a day i have to check for the existence of a file that has an incrementing number in it's filename that is related to the day of year, as such:
today's check should find a file called file439.txt
tomorrow's check should find a filename called file440.txt
the day aftyer that: file441.txt

So i based my test on the current day of the year (%jjj%) with a fixed number of days added to it, and it didn't work past the number 366. I'll try and figure out if i can test another way.
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

Sorry, I don't see built-in option that can do such trick.
I think you need simple script that can be used with Active Script or Shell Script test method..

Regards
Alex
Post Reply