Hello from Oklahoma City,
My name is Andreas I noticed your post looking around for something about
subtracting two variables but my vars are dates converted to strings but I
can't seem to get the two vars to subtract I started with a bash script.
#!/bin/bash
# TO PRINT THE NUMBER OF DAYS SINCE LAST AV UPDATE
past_date=$(du -h --time testdate | grep -Eo
'[[:digit:]]{4}-[[:digit:]]{2}-[[:digit:]]{2}')
# Perform a subtraction of past_date string
# from today's string divided by seconds times 12 hour days
diff=$((($(date +%s)-$(date +%s --date "$past_date"))/(3600*24)))
echo It has been $diff days since the last AV DAT update
Any advice would be great.
Andreas Magana
Oklahoma City, OK
On Tuesday, February 14, 2017 at 10:28:38 AM UTC-6, bablu wrote:
>
> - name: Set the output of the this state
> set_fact: A="{{image_avl.stdout}}" -- this is coming from
> the previous registered output
> tags: avl1
>
> - name: Define our static value for the desired image number
> set_fact: B={{retain}} -- this is coming from
> the inventory
> tags: num2
>
> - name: difference
> shell: C=`expr "{{image_avl.stdout}}" - {{retain}}`
> register: num_del
> tags: del1
> - debug: var="num_del"
>
> On Tue, Feb 14, 2017 at 8:58 PM, Dick Visser <[email protected]
> <javascript:>> wrote:
>
>> On 14 February 2017 at 16:12, DHAVAL JAISWAL <[email protected]
>> <javascript:>> wrote:
>> > solved it.
>>
>> Well done!
>>
>> Any chance of sharing *how* you solved it?
>>
>>
>> Thanks,
>>
>> --
>> Dick Visser
>> Sr. System & Network Engineer
>> GÉANT
>>
>> Want to join us? We're hiring: https://www.geant.org/jobs
>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "Ansible Project" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/ansible-project/keIYWBBA1c8/unsubscribe
>> .
>> To unsubscribe from this group and all its topics, send an email to
>> [email protected] <javascript:>.
>> To post to this group, send email to [email protected]
>> <javascript:>.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/ansible-project/CAL8fbwNOB9bkDrzDzOcBCKTY6EbbrfMxWwzHLCD2zpm_w6KfxQ%40mail.gmail.com
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> Thanks & Regards
> Dhaval Jaiswal
>
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/5ba83f5f-eaf5-4035-bff7-58811a3da1a3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.