User:Ken Takusagawa
From The scripts.mit.edu Wiki
Contents |
Mail Scripts
formail
formail is useful, for example in the procmail pipeline
| formail | /usr/sbin/sendmail
last case
at the bottom
:0 * ! your_regular_username@mit.edu
forwards any mail not processed back to you
GnuPG
gpg is installed on scripts. Using the flags
gpg --lock-never --no-random-seed-file --keyring \ /afs/athena.mit.edu/user/f/o/foobarusername/mail_scripts/pubring.gpg
allows scripts to use gpg without having to have write access to the gpg lock files etc.
MIME
I need to figure out how to deal with MIME encoded mail. mhstore is on Athena (don't know about scripts), and there are probably pure Perl solutions.
Scheduled Jobs Service
lock files
$lockfile='/afs/athena.mit.edu/user/k/e/kenta/foobar/lock'; if (-e $lockfile ){ die "alarm's lock exists : $lockfile"; } system("touch",$lockfile)==0 or die "cant execute touch: $?"; ... do stuff ... unlink $lockfile or die "failed to delete lockfile";
Another way is to look through the output of ps
.
Zephyr
It is difficult to create a zephyr logger on scripts. Scripts.mit.edu maintainers do not encourage that your Kerberos credentials every touch the machine; however this is the only way to authenticate as you to zephyr server, e.g., to receive your personal zephyrs.
However, if you trust that there won't be a break-in to scripts which reads your data (you shouldn't trust), you can create a keytab using ktutil
, store it on a daemon.scripts readable part of your AFS, use it to kinit on scripts, and get zephyrs. You should have your keytab expire quickly, but you'll still get zephyrs.