Skip to content

Instantly share code, notes, and snippets.

@rbochet
Created December 24, 2010 15:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save rbochet/754343 to your computer and use it in GitHub Desktop.
Save rbochet/754343 to your computer and use it in GitHub Desktop.
Shell script for printer cron
#!/bin/bash
# Romain Bochet
# Use as a cron
# Print all the files included in a folder with lp, and move them into another folder.
# Use absolute path (mandatory for crons)
SOURCE="/home/dropbox/print/"
DONE="/home/romain/printed/"
for FILE in `ls $SOURCE`
do
/usr/bin/lp $FILE
/bin/mv "$SOURCE$FILE" $DONE
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment