Upgrade from 8.5.4 to 9.0.0 broke List file(s) Date filter - VisualCron - Forum

Community forum

Announcement

The VisualCron forum is no longer monitored by VisualCron Support - it is a community forum. Please use our contact page - this ensures tickets are created and prioritized. Thank you!

MRomer
2019-12-17T20:38:22Z
I upgraded a test server (Windows Server 2016) from 8.5.4 to 9.0.0, and one of the jobs started having problems. The task having the issue was a List file(s) task where I set beginning and end dates based on a job variable that was set in a previous task. The same job running on our Production server (Windows Server 2012 R2) under 8.5.4 is still working.

The task is defined thus (all variables have valid values):
File Filter > Location:
Folder: {USERVAR(logFolder)}
Exclude folder(s): <blank>
Include file mask: *
Is regex: unchecked
Case sensitive: unchecked
Use file exclusion: checked
Exclude file mask: *.zip
File filter > Date:
Modified date < {DATENOWADD(Days|-{MATH(Add|Integer|-1|{JOB(Active,Variable,oldestFileAge)}|#0)}|M/d/yyyy 00:00:00)}
AND
Modified date > {DATENOWADD(Days|-{JOB(Active,Variable,oldestFileAge)}|M/d/yyyy 00:00:00)}
Validate dates before saving: checked.

The goal of this task is to list all files that are not .zip files, which have a modified date between 12 AM on the oldest file's date and 12 AM on the next day.

Opening this task and attempting to re-save it produces the following error:
Field 'Newer than' value is an invalid date. Try matching accepted server format: 12/16/2019 1:29 PM

I've tried changing the formula to things like "{DATENOWADD(Days|-{JOB(Active,Variable,oldestFileAge)}|M/d/yyyy)} 12:00 AM", but am still getting the error. So far, the only thing that has not thrown the error is setting the field to a constant like "12/16/2019 12:00 AM".

What can I try?
Sponsor
Forum information
Support
2019-12-18T10:35:34Z
Please export the Job and send to support@visualcron.com
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
MRomer
MRomer
2019-12-18T22:34:50Z
More info: I reverted the test server back to a snapshot taken before I did the upgrade to VC 9.0.0. This time I upgraded it to 8.5.5. The date selections worked like they do on the production server. That is, comparing Modified date to

{DATENOWADD(Days|-{MATH(Add|Integer|-1|{JOB(Active,Variable,oldestFileAge)}|#0)}|M/d/yyyy 00:00:00)}

and

{DATENOWADD(Days|-{JOB(Active,Variable,oldestFileAge)}|M/d/yyyy 00:00:00)}

selected files with modified dates during the specified 24-hour window. No errors were generated.
MRomer
2020-05-14T15:43:12Z
An update: I upgraded VisualCron on the test server from 8.5.5 to 9.1.5 and took another look at the job. I still get this error when I open and save the List Files task:

image.png

I tried changing the "00:00:00" in the time portion to "12:00 A\M" and got the same error:

image.png
MRomer
2020-05-14T19:02:39Z
I finally figured out a workaround. I created two more job variables, dateRangeStart and dateRangeEnd. These get calculated based on the oldestFileDate variable:
image.png
image.png

Even though VC was translating the variables to constants, I still could not use them directly in the date selection. I had to wrap them in a date function. The one I chose was DATEADD:
image.png

My job is now working like it was before the upgrade. I'm still mystified that the formulae I was using before the upgrade failed validation in the new version. What I've had to do is a bit clunky, I think.
MRomer
2020-05-14T19:16:23Z
To be clear, I not only had to create two new job variables, but I had to create two new tasks to set their values as constants, plus wrap those constant values in a date function in order to use them. Took a lot of trial and error to figure out, and was very frustrating, considering how the older version of VC handled the previous setup just fine.
Announcement

The VisualCron forum is no longer monitored by VisualCron Support - it is a community forum. Please use our contact page - this ensures tickets are created and prioritized. Thank you!

Scroll to Top