Benutzer-Werkzeuge

Webseiten-Werkzeuge


ubuntu_print

Dies ist eine alte Version des Dokuments!


Drucken aus Ubuntu

mkdir Drucken
cd Drucken
mkdir gedruckt
sudo apt-get install notify-tools
nano notify.sh
inotifywait -m . -e create -e moved_to |
    while read dir action file; do
        echo "The file '$file' appeared in directory '$dir' via '$action'"
        sleep 5 # sonst meint der Mac, es wäre nicht angekommen
        if [ $action = 'CREATE' ]
        then
            extension="${file##*.}" # nur PDFs abfragen, da der Mac auch Dateien mit ".*" reinschreibt
            if [ $extension = 'pdf' ]
            then
                mv $file gedruckt
                lp gedruckt/$file
            fi
        fi
    done
crontab -e
@reboot /home/*/Drucken/notify.sh >> /home/*/Drucken/gedruckt/notify.log 2>&1

Am Mac: afp:192.168.178.26 (da muss ich noch schauen, dass das mit Namen geht) Name/Passwort: „Vorname Nachname“ (wundert mich, dass das geht, wo doch in Ubuntu der Kurzname drin steht) Teil eines Dateinamens: https://stackoverflow.com/questions/965053/extract-filename-and-extension-in-bash Bash if statement: https://ryanstutorials.net/bash-scripting-tutorial/bash-if-statements.php

ubuntu_print.1588353857.txt.gz · Zuletzt geändert: 2020/05/01 17:24 von varnholt