Created
February 12, 2019 01:21
-
-
Save luclu7/b24d0a3283a00937cb537a34b73afdc8 to your computer and use it in GitHub Desktop.
Useful script for a fast scan on *nix (needs Imagemagick and sane)
This file contains hidden or 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
#!/bin/sh | |
echo "Start time :" | |
date | |
target_name=$(date '+%Y-%m-%d_%H-%M-%S') | |
folderroot=/mnt/scans | |
folder=$folderroot/$(date +%Y/%m/%d) | |
fullpath=$folder/$target_name.ppm | |
finalpath=$folder/$target_name.png | |
scanimage_options="--mode color --resolution 150" | |
mkdir -p $folder | |
echo "Scanning..." | |
scanimage $scanimage_options > $fullpath | |
cd $folder | |
echo "Conversion of $fullpath to png" | |
convert -quality 100 "$fullpath" "$finalpath" | |
rm "$fullpath" | |
echo "End time :" | |
date |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment