Created
July 12, 2018 12:48
-
-
Save officeokano/6b02f3778103e6128dad7c3bf3b94d67 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ls *.PNG > /dev/null 2>&1; then | |
printf "rename PNG to png\n" | |
rename 's/.PNG/.png/' *.png | |
fi | |
if ls *.png > /dev/null 2>&1; then | |
printf "convert png to jpg\n" | |
mogrify -format jpg -quality 95 *.png | |
archivename=`date "+%Y%m%d-%H%M-%S%N"` | |
printf "add original files to an archive $archivename.tar\n" | |
mkdir $archivename | |
mv *.png $archivename/ | |
tar uvf $archivename.tar $archivename | |
printf "remove original files\n" | |
rm -r $archivename | |
printf "done\n" | |
else | |
printf "nothing to do\n" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment