home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / lang / perl / 6944 < prev    next >
Encoding:
Internet Message Format  |  1992-11-11  |  2.6 KB

  1. Path: sparky!uunet!gossip.pyramid.com!olivea!inews.Intel.COM!fxrs!glewis
  2. From: glewis@fws204.intel.com (Glenn M. Lewis - ICD ~)
  3. Newsgroups: comp.lang.perl
  4. Subject: Perl Printer Daemon?
  5. Message-ID: <GLEWIS.92Nov11121920@fws204.intel.com>
  6. Date: 11 Nov 92 20:19:20 GMT
  7. Sender: news@inews.Intel.COM (USENET News System)
  8. Reply-To: glewis@pcocd2.intel.com
  9. Distribution: comp
  10. Organization: Intel Corporation, Folsom, CA
  11. Lines: 45
  12. Nntp-Posting-Host: fws204
  13.  
  14.  
  15.     I have a peculiar application, for which I think Perl would be
  16. a good candidate to get the job done, but need input and advice.
  17.  
  18.     I would like to start up a Perl script on my UNIX workstation
  19. that simply looks in a directory for any file.  If no file is there,
  20. sleep for a little while and then check again.  If there *is* a file,
  21. I would like the script to perform an eensy bit of filtering on it
  22. (strip out ^M and ^D), and then send it off to a UNIX printer, using
  23. "lpr" and the "-r" flag to remove the file.  (I have very little
  24. understanding of "cron" or if "cron" could be used by an average-joe
  25. [read: non-super] user to make sure this script is always running, but
  26. that is a side issue that maybe someone could teach me about.)
  27.  
  28.     I could probably figure out how to do the above part, with a
  29. little time.  Now comes the tricky part...  I would like this script
  30. to also check the printer queue every so often, to see if it is making
  31. progress.  Yes, this sketchy, because huge print jobs will take a long
  32. time, and from the "lpq" standpoint, it is not easy to determine if
  33. progress is being made.  Neglecting this side issue, if the script
  34. determines that progress is *not* being made, I would like it to:
  35.  
  36.     1) Log into a remote machine with an embedded username and
  37.        password (which should be secure, btw),
  38.     2) Execute commands on the remote machine to get the printer going
  39.        again, and
  40.     3) logout of the remote machine and continue checking the
  41.        directory.
  42.  
  43.     Does all this seam feasible?  Any e-mail replies would be
  44. greatly appreciated!
  45.     Thanks!
  46.  
  47.                         -- Glenn Lewis
  48.  
  49. P.S.  If you are saying to yourself "Why does he want to do *that*?"...
  50.       I have a network of PC's I want to print on a UNIX printer.  I
  51.       can write files to a UNIX directory from those PC's, but they
  52.       have crud in them like ^M's and ^D's that I need to strip.  The
  53.       challenge is that this printer daemon goes down about every 2
  54.       hours and needs restarting, and only I know how, in our group,
  55.       and our operations wants to keep it that way.  So I wish to
  56.       automate it.  Does this make sense?  Thanks again.
  57. --
  58. Glenn Lewis | glewis@pcocd2.intel.com | These are my opinions...not Intel's
  59.