It could be this kind of problem  
http://linuxshellaccount.blogspot.com/2008/12/why-du-and-df-display-different-values.html

`df` reads only and trusts completely to superblocks.

Another reason could be, that you can have other running process that can 
keep a deleted file open. 


Do you have any process

Dne středa 25. března 2020 17:54:07 UTC+1 Shifa Shaikh napsal(a):
>
> @Kia Hi, 
>
> As suggested I tried 
>
> item.size_total instead of item.size_available
>
>  "{{ ansible_host }}_{{ item.mount }}: {{ (100 * ((item.size_total - 
> item.size_available) / item.size_total)) | round(1, 'common') }}" 
>
>
>
> but it still gives me 22.2 % value instead of 19%
>
> Can you please let me know what's wrong and why the difference?
>
> On Wednesday, March 25, 2020 at 10:10:24 PM UTC+5:30, Kai Stian Olstad 
> wrote:
>>
>> On Wed, Mar 25, 2020 at 07:15:51AM -0700, Shifa Shaikh wrote: 
>> > 
>> >     "{{ ansible_host }}_{{ item.mount }}: {{ (100 * ((item.size_total - 
>> item.size_available) / item.size_available)) | round(1, 'common') }}" 
>>
>> That is not how you calculate percentage, you need to divide on 
>> item.size_total 
>> and not item.size_available. 
>>
>> -- 
>> Kai Stian Olstad 
>>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/697e8d58-ba80-4322-80c0-3c3166e6b7f4%40googlegroups.com.

Reply via email to