Hi.
iv'e been looking around the web trying to find a suitable script to use with my hltv servers , unfortunately to no avail :( .
I'm just wondering if anyone here could perhaps help me out with a shell script to do what i need it to , i would be most grateful .
Here is what i need from the script :
Basically i run a lot of game servers ( may be able to offer whoever helps me something as im an admin of a very big server provider ) , so what i need from the shell script is for it to scan my hltv's directories for any .dem files , then i need it to compress them ( preferabbly in zip format) , then i need it to move the zipped files to a web directory , and then delete the original .dem files .
i did find a script that i thought would work which was this :
#!/bin/bash
HLDS=/home/dlmczt/hlds/czero/ #Working directory where demos are
REP=/var/www/html/czhltv/ #copying directory
#FORMAT="tar cvf"
#EXTENSION=tar
FORMAT=zip #Compression using ZIP
EXTENSION=zip #Associated extension
cd $HLDS
for files in `ls *.dem` do
$FORMAT $files.$(date +%s).$EXTENSION $files
echo "$files.$(date +%s).$EXTENSION compressed"
mv $files.$(date +%s).$EXTENSION $REP
echo "$files.$(date +%s).$EXTENSION moved"
rm $files
echo "$files deleted"
done;
echo "Demos are available in : $REP"
however all i got when i tried to run it was :
./zipped.sh: line 10: syntax error near unexpected token `$FORMAT'
./zipped.sh: line 10: ` $FORMAT $files.$(date +%s).$EXTENSION $files'
i tried using the full path to the interpreter and other things , but no joy .
if you think you can fix this problem then that would be great and probably save alot of time .
If not is there anyone who could make me a script ? , i can tell you any paths you need .
the distro is Fedora Core 4 .
Thanks in Advance.