sandbox


batch scanning
April 21, 2008, 4:03 pm
Filed under: nerd, open source

As vezes é necessário copiar uma quantidade bizarra de arquivos, uma maneira simples de colocar em batch esta tarefa.

 1 #!/bin/bash
 2
 3 device="hpaio:/usb/Photosmart_C3100_series?serial=BR73NGQ13X04KV";
 4
 5 while true;
 6
 7     do if [[ -a stop_file ]];
 8         then break ;
 9     fi;
10
11     echo "scanning" ;
12     name=`date +%s` ;
13     scanimage -d $device -p >$name.pnm;
14
15     convert $name.pnm $name.jpg;
16     rm $name.pnm;
17
18     echo "sleeping" ;
19     sleep 10s;
20
21     do if [[ -a stop_file ]];
22         then break ;
23     fi;
24
25 done

No Comments Yet so far
Leave a comment



Leave a comment
Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>