I made a script to copy an image to a temporary directory, convert it to an another format, then move it to a final directory. But i can't get the chmod command to work, the file is copied to the temporary directory but it's chmod is stuck on -rw------- (the original chmod of the file).
If i apply a 777 chmod on the original file, the copied one get a -rwx------ instead of a -rwxrwxrwx
The copied and orignal files have the same user.
TS=$(date +"%Y")/$(date +"%m")/$(date +"%d")/$(date +"%Hh%Ms%S") PATHTMP="/tmp/faxtiff" mkdir -p $PATHTMP chmod 777 $PATHTMP cp $FILE $PATHTMP chmod 777 $PATHTMP/$FILE convert $PATHTMP/$FILE -scale '50%x100%!' $PATHTMP/fax.jpg chmod 777 $PATHTMP/fax.jpg mkdir -p /home/argent/faxes-recus/$TS chmod 777 /home/argent/faxes-recus/$TS #rm $PATHTMP/$FILE mv $PATHTMP/*.jpg /home/argent/faxes-recus/$TS