process img test
authorniekt0 <niekt0@kyberia.cz>
Thu, 4 Nov 2010 18:05:28 +0000 (19:05 +0100)
committerniekt0 <niekt0@kyberia.cz>
Thu, 4 Nov 2010 18:05:28 +0000 (19:05 +0100)
cron/process-images.sh

index 2afd6dcb76453b1528a3682164af3710397a1d04..e0f6936497c1a7dae1e1e34c4f1999cf862a6981 100755 (executable)
@@ -5,12 +5,14 @@
 
 # Created & maintained by maniax
 
-cd /storage/system/www-root/kyberia.sk/process-img
+#cd /storage/system/www-root/kyberia.sk/process-img
+
+echo "`pwd`"; >> /tmp/log1
 
 PREPARED_FILES=`ls prepared/`
 CURRENT_DATE=`date`
 
-for PREPARED_FILE in $PREPARED_FILES
+for PREPARED_FILE in "$PREPARED_FILES"
 do
   echo "[$CURRENT_DATE] Processing file: $PREPARED_FILE" >> process-img.log
 
@@ -27,12 +29,12 @@ do
 
   rm -f prepared/$PREPARED_FILE
 
-  TGT_PART1=`echo $NODE_FILENAME | cut -b 1`
-  TGT_PART2=`echo $NODE_FILENAME | cut -b 2`
+  TGT_PART1=`echo "$NODE_FILENAME" | cut -b 1`
+  TGT_PART2=`echo "$NODE_FILENAME" | cut -b 2`
 
-  mv ready/$NODE_FILENAME ../images/nodes/$TGT_PART1/$TGT_PART2/$NODE_FILENAME
-  chgrp www ../images/nodes/$TGT_PART1/$TGT_PART2/$NODE_FILENAME
-  chmod 664 ../images/nodes/$TGT_PART1/$TGT_PART2/$NODE_FILENAME
+  mv ready/"$NODE_FILENAME" ../images/nodes/"$TGT_PART1/$TGT_PART2/$NODE_FILENAME"
+  chgrp www ../images/nodes/"$TGT_PART1/$TGT_PART2/$NODE_FILENAME"
+  chmod 664 ../images/nodes/"$TGT_PART1/$TGT_PART2/$NODE_FILENAME"
 
   echo "[$CURRENT_DATE] Finished file processing." >> process-img.log
 done
This page took 0.154558 seconds and 4 git commands to generate.