Monday, September 12, 2005

Two ways to view crons for all users

cd /var/spool/cron
* each user has a file
smc -> services

Edit cron jobs

crontab -e

View cron jobs

crontab -l

How many date fields in crontab file?

five
* displayed backwards of "date" output

Editing crontab needs this var

EDITOR=vi
* export EDITOR

Add at job

at 9 pm
find / -type d -perm -1000
Ctrl-D

Two ways to view at jobs

atq
at -l

View what at job is

cat jobID in /var/spool/cron/atjobs

If neither /etc/cron.d/at.allow nor at.deny exist

only root can use at

If /etc/cron.d/at.deny exists

all but in at.deny can use at

If /etc/cron.d/at.allow exists

only those in at.allow can use at

Sunday, September 11, 2005

View list of kill signals

kill -l

By default, kill uses this signal number

15 - SIGTERM (terminate)

Kill process nscd by name

pkill nscd

List both users and processes with prstat

prstat -a

Graphical prstat

Tools -> Find Process

Is brother12 accepting requests?

lpstat -a brother12

Deactivate printer and cancel current job

disable -c brother12
* -c cancel

Deactivate a printer, but let current job finish

disable -W brother12
* -W wait

Stop queueing because "no ink"

reject -r "no ink" brother12

What's POSIX?

Portable Operating Systems Interface for uniX
* set of standards for Unixes

Three steps to remove printer from server

reject brother12
disable brother12
lpadmin -x brother12
* removes from /etc/printers.conf and /etc/lp/printers

Delete printer from a client

lpadmin -x brother12

Command to set default printer

lpadmin -d brother12

Summary of printing

lpstat -t

Add printer to class bld2

lpadm -p brother12 -c bld2
* a way to load balance printers

After adding a class?

accept bld2
* classes cannot be enabled/disabled like printers

Allow root start X11 apps from term

cp /export/home/sergey/.Xauthority /

Saturday, September 10, 2005

When setting up a print server consider

the size of /var/spool/lp
* spooling space is the most important factor

Two vars for default printer

LPDEST
PRINTER

If no vars, we look for _default in

~/.printers
/etc/printers.conf

If no vars and no files, we look in

/etc/nsswitch.conf for "printers"
LDAP or NIS can be used

What's the diff between lp and lpr

Both do the same tasks
/usr/bin/lp - System V
/usr/ucb/lpr - University of California, Berkeley

Printing history

/var/lp/logs/requests
* can find the culprit who printed 100 pages

Stop, start printing quickly

/usr/sbin/lpshut
/usr/lib/lpsched <- daemon itself