3 # XXX do we even need this?
4 # configure_image_new could resize image itself
6 # Script na upravu uploadnutych obrazkov k nodes (backend k eventu configure_image_new #2105641)
7 # Spustane z CRONu cca raz za 2 - 5 minut
9 # Created & maintained by maniax
11 #cd /storage/system/www-root/kyberia.sk/process-img
13 echo "`pwd`"; >> /tmp
/log1
15 PREPARED_FILES
=`ls prepared/`
18 for PREPARED_FILE
in "$PREPARED_FILES"
20 echo "[$CURRENT_DATE] Processing file: $PREPARED_FILE" >> process-img.log
22 if [ `echo $PREPARED_FILE | grep .upload | wc -l` -eq 1 ]
24 echo "[$CURRENT_DATE] Skipping file..." >> process-img.log
28 RQ_DIMENSIONS
=`echo $PREPARED_FILE | cut -b 1-3`
29 NODE_FILENAME
=`echo $PREPARED_FILE | cut -b 5-`
31 convert prepared
/$PREPARED_FILE -coalesce -resize "$RQ_DIMENSIONSx$RQ_DIMENSIONS>" ready
/$NODE_FILENAME
33 rm -f prepared
/$PREPARED_FILE
35 TGT_PART1
=`echo "$NODE_FILENAME" | cut -b 1`
36 TGT_PART2
=`echo "$NODE_FILENAME" | cut -b 2`
38 mv ready
/"$NODE_FILENAME" ..
/images
/nodes
/"$TGT_PART1/$TGT_PART2/$NODE_FILENAME"
39 chgrp www ..
/images
/nodes
/"$TGT_PART1/$TGT_PART2/$NODE_FILENAME"
40 chmod 664 ..
/images
/nodes
/"$TGT_PART1/$TGT_PART2/$NODE_FILENAME"
42 echo "[$CURRENT_DATE] Finished file processing." >> process-img.log
This page took 0.268137 seconds and 4 git commands to generate.