- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- print to an email
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-14-2005 11:22 PM
тАО07-14-2005 11:22 PM
If so, can they post it, or give me a procedure to configure it?
We are having problems with non-IT management moving their staff around on a daily basis (but not the printers) and expecting the UNIX printouts to follow them by magic. Since the application controls a lot of printing I do not want the overhead and risk of doing daily printer configuration changes - email the reports to them let them sort out their own printers in windows if they want to.
The application does not allow people to specify their own print destinations - that would be a huge change for us.
If anyone has any other creative solutions to this please say so.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-14-2005 11:29 PM
тАО07-14-2005 11:29 PM
Re: print to an email
You could always use a wrapper script of sorts...
I don't print to email - but I don't see why not - I redirect SAP printing to a wrapper script - depending on the printer - I do different things:
Example:
case $P in
C003)
xebec
exit
;;
dschq)
dschq
exit
;;
hrchq)
hrchq
exit
;;
oschq)
oschq
exit
;;
dserp)
dserp
exit
;;
qaerp)
qaerp
exit
;;
*)
print_hp
exit
;;
esac
Example - the XEBEC one - ftp's a file:
#################################################
# xebec
#################################################
function xebec
{
Outpath=/var/spool/lp/receive/XEBEC
PSMServer=prprt
# Strip path if any and take only filename
Filename=`echo $F | sed 's/.*\///'`
# Append filename to output file path
Fileout=$Outpath/${Filename}
rcp $F ${PSMServer}:$Outpath
rtc=$?
if test "$rtc" != 0
then
echo "Cannot move $F to $Fileout"
echo "Cannot move $F to $Fileout" 2>&1
exit $rtc
fi
# ftp the file
remsh $PSMServer /usr/local/lp/xebecftp $Fileout 2>&1 /dev/null
rtc=$?
if test "$rtc" != 0
then
echo "xebecftp returned error code $rtc"
echo "xebecftp returned error code $rtc" 2>&1
exit $rtc
fi
exit
So - you could email...
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-14-2005 11:29 PM
тАО07-14-2005 11:29 PM
Re: print to an email
Not exactly what you're looking for, but a suggestion for a different way to handle it.
We use one of the GECOS fields (office location) in /etc/passwd to store the user's default printer and then use /etc/profile to retrieve it and set it like this:
# Set each user's individual preferred printer
PRINTER=`/usr/bin/pwget -n $USER | line | cut -d, -f2`;export PRINTER
LPDEST=$PRINTER;export LPDEST
This way, when a user changes locations, it's a simple matter to change /etc/passwd and the next time they log in, they're directed to their new printer.
Might work for you.
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-14-2005 11:44 PM
тАО07-14-2005 11:44 PM
Re: print to an email
Using the GECOS field is our current solution - just as you documented. The problem I have is that sometimes the user's new printers have never been configured on the server or the users are unable to give me the printer details and I have no remote support at these sites.
I don't want to have to update lots of these entries each day, especially with our new SOX compliant change-management overhead.
Geoff, where does that script get put?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-15-2005 12:05 AM
тАО07-15-2005 12:05 AM
Re: print to an email
I've attached them in there entirety.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-15-2005 12:05 AM
тАО07-15-2005 12:05 AM
SolutionI've attached them in there entirety.
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-15-2005 12:56 AM
тАО07-15-2005 12:56 AM
Re: print to an email
Could I just copy the dumb model script to something else, remove some of the formatting and mailx/sendmail instead of lprcat and lpbanner ?
Any comments?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-15-2005 01:08 AM
тАО07-15-2005 01:08 AM
Re: print to an email
You can have a file as printer by doing following.
touch /tmp/print_file
chown lp:bin /tmp/print_file
chmod 644 /tmp/print_file
lpadmin -pprint_file -v/tmp/print_file -mdumb
lpshut and lpsched
that's ALL.
lp -dprint_file /etc/hhosts
check /tmp/print_file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-15-2005 02:00 AM
тАО07-15-2005 02:00 AM
Re: print to an email
I tried to copy the dumb printer model to a new one called email, which uses mailx on the file being printed.
The current problem is that the /etc/mail/aliases file translates my UNIX userid into StephenLewis@mycompany and
the lp file contains this:
The flags you gave are used only when sending mail.
Lewis...User unknown
Stephen... User unknown
/var/spool/lp/dead.letter... Saved message
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-15-2005 03:58 AM
тАО07-15-2005 03:58 AM
Re: print to an email
I fixed the bug which was with my stupid code and now it works.
I finally did it my way - created a pseudo device file for lpadmin and made a copy of the dumb model script called email.
Instead of writing the data to the file it simply uses mailx straight to the userid for each file, not using a banner and forcing only 1 copy.
/etc/mail/aliases translates the unix ids to windows fqdn ones.
It doesn't require any process continuously looping around searching for requests.
No application code change required for that, thank goodness.
So now subject to change board approval, users will be able to request an LPDEST of 'email' and all their reports will go to their inbox, so they can print from Outlook, managing their own printers from windows and not bother us sysadmins.
Feet up on the desk again...zzzzzz...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-15-2005 05:49 AM
тАО07-15-2005 05:49 AM
Re: print to an email
Thanks...Geoff