Sometimes there is a need to find items modified in an interval of time. This example helps to develop a job to facilitate this.
In the UserVariable task, the olderthan_days and newerthan_days variables are to ease the adjustment of the job. Whenever the need of altering the interval comes up, only these two variables have to be edited, every other aspect of the configuration can be left untouched.
Values/scripts for the variables:
olderthan: {add_start:{now}}-{math_start}{olderthan_days}*86400000{math_end}{add_end} newerthan: {add_start:{now}}-{math_start}{newerthan_days}*86400000{math_end}{add_end}
The add_start and math_start CrushTask Functions (https://www.crushftp.com/crush10wiki/Wiki.jsp?page=CrushTask%20Functions) are basically multiplying the days entered manually and extract from the current time - the {now} variable -, both are in epoch time.
The Find task doesn't need much adjustment but the Depth of the folder structure has to be considered and the task configured accordingly.
Add new attachment
List of attachments
Kind | Attachment Name | Size | Version | Date Modified | Author | Change note |
---|---|---|---|---|---|---|
png |
find_interval1.png | 94.7 kB | 1 | 19-May-2023 11:17 | Sanci | |
png |
find_interval2.png | 33.1 kB | 1 | 19-May-2023 11:23 | Sanci | |
png |
find_interval3.png | 25.5 kB | 1 | 19-May-2023 12:47 | Sanci | |
png |
find_interval4.png | 25.2 kB | 1 | 19-May-2023 12:54 | Sanci |