I am writing a script to write the output of df -g to a text file once a week.
here's my script, I think it should work, but whenever I try and run it as root by typing ./check_space.sh I get the following error:
./check_space.sh: line 13: syntax error near unexpected token done'
./check_space.sh: line 13:
done'
#!/bin/bash
#this script will run every week to grab a df -g and output it to a file.
#times to sleep
#10080 = 1 week
#date command
NOW=$(date +"%m.%d.%y")
while true, do
df -g > /sds/app/force/custom/dumplogs/harddisk/$NOW.log
#sleep 10080
done
originally I was thinking of running this script in a screen session, that is why the Sleep is in there, but I quickly decided that it would be better to run it as a cron once a week.