Hello this is my first post on these forums.
For a little back ground into this, I recently installed a Linux server with the purpose of recording matches via a program called HLTV.
Now what I want to do is take the individual .dem files compress them one by one then move the compressed files to a different folder and delete the originals
I found a script that seemed to do the job but it doesn’t work and I can’t seem to debug it.
#!/bin/bash
HLDS= /hlds/cstrike/ #Working directory where demos are
REP=/hlds/cstrike/demos/ #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"
the source folder is /hlds/cstrike
destination folder is /hlds/cstrike/demos
file type is .dem
Thanks for any help.