I’m trying to get the the number of days that has passed since a date thats returned from relevance and now, something like:
current date - "Sat, 08 Aug 2015"
but I’m getting an error “Singular expression required”, presumably because it thinks the relevance might return multiple answers. The relevance I’m using to return the date is:
current date - (maxima of ( (it as date ) of ( ((it as integer as string) of preceding text of last "/" of following text of first "/" of it ) & " " & (preceding text of first "/" of it as integer as month as three letters)& " " & "20" & (following text of last "/" of it as integer as string)) of preceding text of first " " of following text of first "I " of it) of lines whose (it contains "Completed backup to") of files whose (name of it as lowercase contains "history.log.0") of folders "/Library/Logs/CrashPlan" as string)
How would I modify this to return number of days?
Thanks!
1 Like
use maximum
instead of maxima
to get the singular and then cast to date so you can use the -
operator
Q: current date - ((maximum of ( (it as date ) of ( ((it as integer as string) of preceding text of last "/" of following text of first "/" of it ) & " " & (preceding text of first "/" of it as integer as month as three letters)& " " & "20" & (following text of last "/" of it as integer as string)) of preceding text of first " " of following text of first "I " of it) of lines whose (it contains "Completed backup to") of files whose (name of it as lowercase contains "history.log.0") of folders "/Library/Logs/CrashPlan" as string) as date)
A: 1 day
2 Likes
Haha, now why didn’t I twig that (maxima being the plural of maximum)? Lovely, thank you!
Is this part of an analysis that you’d be able to share on BigFix.me?
Absolutely! Are you using Crashplan too? Let me finish it off and polish it up and I’ll share it there.
1 Like
Awesome, thanks! Yep, we’re using CrashPlan or at least investigating it.
1 Like
we’ve got crashplan here at IBM for our Macs
2 Likes
Oddly enough, we use IBM’s Tivoli Storage Manager (TSM) for most of our backups
1 Like