Tore Høivaag Larsen
1997-Nov-02 09:35 UTC
Samba FAX: Need script for mgetty+sendfax solution..
Hi, To avoid reinventing the wheel I need to know whether anyone have made a script (bash) that pick out relevant information about the latest job and logs it on a printer attached to the samba fax host. I'd like to pick out info from the files: /var/spool/fax/outgoing/printfax.log /var/spool/mail/<user> or /var/spool/fax/outgoing/faxrunqd.asc /var/spool/fax/acct.log /var/spool/fax/faxrunqd.log and get a result like this: [11/01/97] 22:48:16 Fax from THL(192.168.1.4) by thl to RH Maisavarre (77777777) spooled F000007 [01.11.97 22:52] Using /dev/cua3 F000007 [01.11.97 22:52] Using /dev/cua3 spawned child (PID 733) Sending f1.g3 Sending f2.g3 F000007 [01.11.97 22:53] Child returns (PID 733) SUCCESS: JOB F000006 BY thl TO 77777777 TRIES 1 TIME 01.11.97 22:49 -> 01.11.97 22:53 TIME ELAPSED = 3 minutes ONLINE = 1 minute COST = 3 Nkr I don't want a script that uses lots of CPU time to check whether a file has changed and the do 'tail -1' on it. I tried that, but it consumes to much CPU time. Is there better way to do this? Sincerely, Tore -- Tore H. Larsen Scase AS Engineer Eidsv?gbakken 1 E-mail: tore.h.larsen@scase.no N-5080 Eidsv?g Vc: +47-55951200 Fax: +47-55257120 Bergen - Norway