Jump to content

How to reference current cache disk space within a container?


Recommended Posts

I'm looking to add a script in a container that needs to pull the current size of the cache disk. The example I'm working from assumes it's pointing at the space available to the /downloads/ folder. But in this case wouldn't  that return the whole array? Can I instead somehow pass through a mapping to reference that would return the available space of the cache disk instead? Would pointing to the /appdata/ folder or the specific applications /appdata/config/ work, since it is already mapped in the container?

 

Here is the example I'm working from:

#!/bin/sh
set -e

reqSpace=250000000 # 250GB
SPACE=$(df "/torrents" | awk 'END{print $4}')
if [ "$SPACE" -le $reqSpace ]
then
  echo "not enough space"
  echo "free $SPACE"
  exit 1
fi
echo "got space"
echo "free $SPACE"
exit 0

 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...