All Products 
Username / Customer#
Password
Log In
 Hi,  |  Log Out
  • Site Search
  • Domain Search
  • WHOIS Domain Check
24/7 Support: (480) 505-8877
Hablamos Español
9 AM to 9 PM IST
7 days a week
Go Daddy Support

Search help articles, forums, and discussion groups

hello guys

Viewing post 1 to 15 (16 total posts)
1 2
Profile picture of jwala

jwala said 1 year, 2 months ago:

hey guys jus tell me a script that checks the available disc space i’m new to developement so please explain the script too……….
the server am using is centos- 64 bit…….. it is not accessible to you guys

the script must have the df -k command

Profile picture of AdamR

GoDaddy Expert adamr said 1 year, 2 months ago:

@jwala

You may want to check out this thread I found at:

http://www.unix.com/shell-programming-scripting/27923-frustrating-disk-space-script.html

or use your favorite search engine to find a script. Hopefully other forum users will be able to provide you with some pointers as well.

-Adam

Profile picture of jwala

jwala said 1 year, 2 months ago:

thanks adamr……..
will check out the code and will tell you……….

Profile picture of jwala

jwala said 1 year, 2 months ago:

Adam one more help from u……
could u jus explain this command am breaking my head since friday

$$ != $(pgrep -f $(basename $0) | head -n 1)

Profile picture of jwala

jwala said 1 year, 2 months ago:

It throws the following error :
df: invalid option — b
Try `df –help’ for more information.
is the file size percent
df: invalid option — b
Try `df –help’ for more information.
discspace.sh: line 13: /root/: Is a directory
discspace.sh: line 14: [: -gt: unary operator expected
enough space available

Profile picture of AdamR

GoDaddy Expert adamr said 1 year, 2 months ago:

@jwala

I’m not very familiar with shell scripts myself. Hopefully other forum users will be able to provide you with some insight. You may also want to try posting your question on a forum like http://www.unix.com/shell-programming-scripting/ that is more geared towards scripting.

-Adam

Profile picture of jwala

jwala said 1 year, 2 months ago:

thanks adam

Profile picture of AdamTux

GoDaddy Contributor adamtux said 1 year, 2 months ago:

@jwala You can use the command df -k, but I think the command ‘df -hTa’ is better since it outputs it in a much easier to read format!

You could even script something to run in crontab every so often and then pipe it to email so you get a daily report. Something like this…

#!/bin/bash
df -hTa | mail -s subject diskuser@emailaddress.com

Profile picture of jwala

jwala said 1 year, 2 months ago:

thanx adamtux…… will check it out and will say…..

Could anyone help me out for this…..
if [ ${check} != "" -a ${check} !="0" ] ; then
this if loop shows too many arguments error

and the part of the code is :

if [ ${check} != "" -a ${check} != "0" ]; then
log_msg “printf $MSG_UPLOAD_PING_INVALID_STATUS ${check}
while :
do
input
case $INPUT in
y* | Y*)
break 2
;;
n* | N*)
break
;;
*)
continue
;;
esac
done
else
break
fi
fi

Profile picture of jwala

jwala said 1 year, 2 months ago:

guys, please help me ou am frustrated by this code

if loop shows en error named “[: too many arguments"
piece of code is here

if [ ${check} != "" -a ${check} != "0" ]; then
log_msg “printf $MSG_UPLOAD_PING_INVALID_STATUS ${check}
while :
do
input
case $INPUT in
y* | Y*)
break 2
;;
n* | N*)
break
;;
*)
continue
;;
esac
done
else
break
fi

(“$MSG_UPLOAD_PING_INVALID_STATUS ${check}” – this will display their corresponding messages. No need to worry about the $ things)

Profile picture of KQ

GoDaddy Contributor kq said 1 year, 2 months ago:

@jwala: you need quotes around the ${check} variable substitution to handle the case where it has no value.

Profile picture of jwala

jwala said 1 year, 2 months ago:

Thanks a lot kg ………….

I have got the output :) :):):):):):)

Profile picture of jwala

jwala said 1 year, 2 months ago:

guys help me out

FILE_SIZE=wc -c "${FILE_PATH}" | awk '{print $1}'

if i execute this command it shows an error as
wc : ???????????????????

could anyone jus help me out?

Profile picture of KQ

GoDaddy Contributor kq said 1 year, 2 months ago:

@jwala: One of the techniques described here will probably help you: http://tldp.org/LDP/abs/html/commandsub.html

Profile picture of jwala

jwala said 1 year, 2 months ago:

thanks kg……. it’s not working…..
I’ve tried like this……

wordcount=wc -c “${FILE_PATH}” | awk ‘{print $1}’
FILE_SIZE=wordcount

1 2

Add a reply:

You will auto join this group when you reply to this topic.

When posting about a technical issue, please be sure to include as many details as possible, such as your domain name, related URLs and other pertinent information. This consideration will allow us to better understand the situation and quickly assist you.