I have a little script i wrote to check if a process is running, and start it if it isn't. This has worked fine but now i have a new issue.
I need to be able to check the space of a users home directory and make the script NOT run the process if it's close to full....any ideas? i'm fairly new to this.
Here is my current script
I need to be able to check the space of a users home directory and make the script NOT run the process if it's close to full....any ideas? i'm fairly new to this.
Here is my current script
Code:
#!/bin/sh
PATH=/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/bin:/sbin
SERVICE='rtorrent'
if pgrep -u $USER $SERVICE > /dev/null
then
echo "$SERVICE service running, everything is fine"
else
echo "$SERVICE is not running, starting $SERVICE"| screen -d -m -S seedbox $SERVICE
fi