How to resize via a cron job?
Posted: 2011-01-23T14:06:50-07:00
Hello,
I am having a real problem, my customers will upload pictures in one of the site folder(the same one),I would like to set a cron job which(every hours) check for newly uploaded pictures and resize them by 800x600.
ImageMagik has been installed on my linux server, someone gave me this code:
#!/bin/bash
DIR=/home/username/public_html/wordpress/pictures/
TIMER=/home/username/timerfile
find $DIR -maxdepth 1 -name "*.jpg" -anewer $TIMER | xargs mogrify -resize 800x600 -quality 85
touch $TIMER
I have 2 problems with this, the person is not familiar with image magik therefore I would need someone else with a good knowledge of this software to check it out please and also what is the $timer? or the "timer file".
Any idea? Do you have an example please?
Thank you,
Ben
I am having a real problem, my customers will upload pictures in one of the site folder(the same one),I would like to set a cron job which(every hours) check for newly uploaded pictures and resize them by 800x600.
ImageMagik has been installed on my linux server, someone gave me this code:
#!/bin/bash
DIR=/home/username/public_html/wordpress/pictures/
TIMER=/home/username/timerfile
find $DIR -maxdepth 1 -name "*.jpg" -anewer $TIMER | xargs mogrify -resize 800x600 -quality 85
touch $TIMER
I have 2 problems with this, the person is not familiar with image magik therefore I would need someone else with a good knowledge of this software to check it out please and also what is the $timer? or the "timer file".
Any idea? Do you have an example please?
Thank you,
Ben