1833609 Members
3833 Online
110062 Solutions
New Discussion

FTP , Processor Speed,LP

 
Sundar_7
Honored Contributor

FTP , Processor Speed,LP

Hi everybody,

This is sundara rajan.So,If anybody can help me by answering the following queries,
please try it.

1)how can we do automatic file transfer
using FTP .Is the only way is to use
.netrc file or is there anyother way

2) how can we find out the processor speed
in a hp-9000 system without rebooting the
machine using the command

3)is it possible for each and every user
be assigned a different defualt printer
destination.how it can be done

ok.i am waiting for ur answers

bye

sundar

Learn What to do ,How to do and more importantly When to do ?
4 REPLIES 4
Shannon Petry
Honored Contributor

Re: FTP , Processor Speed,LP

For each user to have a different default printer you would have to give them access to the spooler and lpadmin. or alias the print command. I.E.
alias lp 'lp -d$myprn'
alias lpr 'lpr -d$myprn'
alias lpq 'lpq -d$myprn'

This will not work however for programs that call the file /usr/bin/lp which many do. The next step would be to mv lp to a different name and script lp looking for each users defined printer.

Next for the automated ftp....
If you search the forums, there are many examples of scripting ftp, which alleviates the dependancy on .netrc.
I use the netrc file though, but here's how and why....
add ftpuser1 to the system for automated ftp. Add ftpuser1 to /usr/lib/cron/cron.allow
make ~ftpuser1/.netrc and init macro which does
bin
prompt
case
lcd incoming
cd host.outgoing
mget *
lcd outgoing
cd host.incoming
mput *
bye

Then schedule a cron job as ftpuser1 to fire off at whatever time as just
01 22 * * * /usr/bin/ftp host

It is very easy to do, and works pretty well withouth lots of scripting or installing expect. Make sure though that ftpuser1 has a legit system credentials and a good password as this user can fire off cron jobs.

As for the processor speed there is a way, and I can not tell you off the top of my head. Search the forums though and I am sure you will find it.
HINT: uses adb and kernel.

Regards,
Shannon
Microsoft. When do you want a virus today?
James R. Ferguson
Acclaimed Contributor

Re: FTP , Processor Speed,LP

Hi:

For processor speed, use SAM -> Performance, or do:

# echo itick_per_usec/D | adb -k /stand/vmunix /dev/kmem

...JRF...
Bill Hassell
Honored Contributor

Re: FTP , Processor Speed,LP

.netrc is one way to automate ftp but since it must reside in $HOME, it is often (accidently) readable by everyone and with plaintext login and password information, this is a bit risky.

A better way is to use a shell script 'here' document to perform the task. Here's a link to recent discussions:

http://my1.itrc.hp.com/cm/QuestionAnswer/1,1150,0xf4677e990647d4118fee0090279cd0f9!0,00.html

As far as defeult lp printers, there is a really easy and versatile method: $LPDEST. When LPDEST is set, all lp commands treat the named print queue as the default. This means that each user can define their own default printer, and also change it without logging back in again:

export LPDEST=ljet5bay6

then just print away...


Bill Hassell, sysadmin
Paula J Frazer-Campbell
Honored Contributor

Re: FTP , Processor Speed,LP

Hi
An automatic FTP routine is in the format of:-

-------------cut here -----------------
ftp -n << End_of_Ftp
user
prompt
put
quit
End_of_Ftp
-------------cut here -----------------

HTH

Paula
If you can spell SysAdmin then you is one - anon