3 # Script na upravu uploadnutych obrazkov k nodes (backend k eventu configure_image_new #2105641)
4 # Spustane z CRONu cca raz za 2 - 5 minut
6 # Created & maintained by maniax
8 cd /storage
/system
/www-root
/kyberia.sk
/process-img
10 PREPARED_FILES
=`ls prepared/`
13 for PREPARED_FILE
in $PREPARED_FILES
15 echo "[$CURRENT_DATE] Processing file: $PREPARED_FILE" >> process-img.log
17 if [ `echo $PREPARED_FILE | grep .upload | wc -l` -eq 1 ]
19 echo "[$CURRENT_DATE] Skipping file..." >> process-img.log
23 RQ_DIMENSIONS
=`echo $PREPARED_FILE | cut -b 1-3`
24 NODE_FILENAME
=`echo $PREPARED_FILE | cut -b 5-`
26 convert prepared
/$PREPARED_FILE -coalesce -resize "$RQ_DIMENSIONSx$RQ_DIMENSIONS>" ready
/$NODE_FILENAME
28 rm -f prepared
/$PREPARED_FILE
30 TGT_PART1
=`echo $NODE_FILENAME | cut -b 1`
31 TGT_PART2
=`echo $NODE_FILENAME | cut -b 2`
33 mv ready
/$NODE_FILENAME ..
/images
/nodes
/$TGT_PART1/$TGT_PART2/$NODE_FILENAME
34 chgrp www ..
/images
/nodes
/$TGT_PART1/$TGT_PART2/$NODE_FILENAME
35 chmod 664 ..
/images
/nodes
/$TGT_PART1/$TGT_PART2/$NODE_FILENAME
37 echo "[$CURRENT_DATE] Finished file processing." >> process-img.log
This page took 1.011941 seconds and 4 git commands to generate.