Audited print workflow. Fetches or receives a document, reports page count and estimated sheets, requires explicit confirmation, then sends to the Ranch Canon MF650C printer. Logs every job. Invoked when a user or Orin wants to print a file, URL, or generated document.
Before a single sheet leaves the printer, Orin confirms. Every job is logged. Nothing prints by accident.
Canon MF650C Series at 192.168.86.181
CUPS name: canon-mf650c (IPP Everywhere driver)
Script: /source/mirrorborn/scripts/print.sh
| Source | Action |
|---|---|
| URL | curl -L -o /tmp/print-job.pdf "<url>" |
| Local file | Use path directly |
| Generated content | Write to /tmp/print-job.pdf or /tmp/print-job.txt |
| HTML/Markdown | Convert via or if available |
weasyprintpandoc# URL download
curl -L -o /tmp/print-job.pdf "https://example.com/report.pdf"
# Markdown → PDF (if pandoc + latex installed)
pandoc input.md -o /tmp/print-job.pdf
pdfinfo /tmp/print-job.pdf | grep -E "Pages:|Title:|Author:"
Report to user:
Document: <filename>
Title: <title if available>
Pages: <N>
Size: <file size>
Always present this summary and wait for explicit y before proceeding:
╔══════════════════════════════════════════════════════╗
║ PRINT JOB CONFIRMATION ║
╚══════════════════════════════════════════════════════╝
File: <filename>
Pages: <N>
Copies: <N>
Duplex: Yes / No
Color: Yes / No (default: grayscale)
Printer: canon-mf650c (Canon MF650C @ 192.168.86.181)
Sheets: ~<N> sheet(s) of paper
Client: <name if known>
Purpose: <description if provided>
Print this job? [y/N]:
Do not proceed if the user says anything other than y or yes.
Log cancellations: [CANCELLED: <file> by <node>] to print log.
bash /source/mirrorborn/scripts/print.sh <file> \
[--copies N] \
[--duplex] \
[--color] \
[--client "<name>"] \
[--purpose "<description>"]
Or, for direct lp:
lp -d canon-mf650c -n <copies> \
[-o sides=two-sided-long-edge] \
[-o ColorModel=Gray] \
<file>
After submission:
Job #<N> sent to canon-mf650clpstat -W completed -p canon-mf650c/var/log/mirrorborn/print-jobs.log# Standard print
bash /source/mirrorborn/scripts/print.sh report.pdf
# Print with options
bash /source/mirrorborn/scripts/print.sh report.pdf \
--copies 2 --duplex \
--client "Harold" --purpose "aeromotive spec"
# Dry run (audit only, no print)
bash /source/mirrorborn/scripts/print.sh report.pdf --dry-run
# Print from URL
curl -L -o /tmp/doc.pdf "https://..." && \
bash /source/mirrorborn/scripts/print.sh /tmp/doc.pdf
Only one agent may print at a time. print.sh uses flock on /var/lock/mirrorborn-print.lock.
/var/lock/mirrorborn-print.lock.owner for diagnostics.Never bypass the lock. If you receive LOCK_BLOCKED, wait and retry. Do not use --force to override a lock — only use --force to override the dedup window.
Each job is keyed by SHA256(file) + copies + duplex + color. If the same job was submitted in the last 5 minutes:
--force only when explicitly instructed (e.g., reprint after paper jam).This prevents double-prints from multiple agents responding to the same instruction.
y before sending. No exceptions.--force.sudo lpadmin -p canon-mf650c \
-E \
-v "ipp://192.168.86.181/ipp/print" \
-m "everywhere" \
-D "Canon MF650C Series (Ranch)" \
-L "Ranch LAN - 192.168.86.181"
sudo lpoptions -d canon-mf650c
To add on other nodes:
ssh -n wbic16@<node>.local "sudo lpadmin -p canon-mf650c -E -v ipp://192.168.86.181/ipp/print -m everywhere && sudo lpoptions -d canon-mf650c"