Skip to content
This repository has been archived by the owner on Feb 14, 2020. It is now read-only.

Calculating disk usage - hangs for ~10 seconds #60

Open
rm-hull opened this issue Oct 28, 2016 · 0 comments
Open

Calculating disk usage - hangs for ~10 seconds #60

rm-hull opened this issue Oct 28, 2016 · 0 comments

Comments

@rm-hull
Copy link

rm-hull commented Oct 28, 2016

Hi,

I was experiencing some issues with archey hanging for approx 10 seconds. I added set -x to the start of the script to see where the problem was, and this line was the cause.

Actually the df command was the problem - I have a SSHFS mount point that had 'gone away': this causes df to timeout after 10 seconds.

Clearly I could unmount it and the problem goes away, but maybe adding a / argument to the df command would make it a bit more robust, and then there's no need for the head -2 either.

e.g.

-disk=$(df | head -2 | tail -1 | awk '{print $5}')
+disk=$(df / | tail -1 | awk '{print $5}')

Happy to provide a PR if that suits?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant