Since a number of users seem to be struggling with the conversion to
Solaris, I thought I would share the scripts I have been using to start my
Python bots from Solaris cron using the job server. If you want to use
these, be sure to substitute your username for "username" in the last line
of listing 1, and your python path (if you have one defined) in the third
line of listing 2.
With these scripts in your home directly, you can then set up a cron job to
run any Python script using the following syntax in your crontab:
30 9 * * * $HOME/pysub jobname $HOME/path/script.py arg1 arg2
"jobname" is an arbitrary name to be given to the job. Be sure to include
$HOME/ in both places; replace /path/ with the path from your home directory
to the Python script.
I don't know as much about bash as I do about Python, so it is very possible
someone else can improve on these scripts. :-) But feel free to use them
if they are helpful.
Russ
Listing 1: pysub
#! /bin/ksh
# like cronsub, but runs a python script instead of a shell script
. /sge62/default/common/settings.sh
[[ $# -ge 1 ]] || {
echo >&2 "usage: $0 <jobname> <script>"
exit 1
}
JOBNAME=$1
shift
SCRIPT=$@
qstat -j $JOBNAME >/dev/null 2>&1 || qsub -N $JOBNAME /home/username/py.sh
$SCRIPT >/dev/null
Listing 2: py.sh
#!/bin/sh
# run an arbitrary Python script
PYTHONPATH=/copy/of;/your/pythonpath
export PYTHONPATH
/usr/bin/python $@
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi,
Since the switch to Solaris a few people have complained about the Sun 'cron'
not being very good. As an alternative to cron, we have now installed
'cronie', which is the RedHat Linux version of cron. This is based on Vixie
cron and offers an almost identical feature set to the old cron on
nightshade.
To avoid a conflict with the system cron, the cronie crontab command is called
'cronie'. To convert your current crontab to a cronietab[0], you can use a
command like this:
% crontab -l >crontab # list existing crontab to file
% cronie crontab # install same as a cronietab
% crontab -r # remove old crontab
You should probably use either crontab or cronie, but not both, since that
could be confusing.
- river.
[0] Yes, "cronietab" is a fairly stupid name. Sorry.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (FreeBSD)
iEYEARECAAYFAk0lXhoACgkQIXd7fCuc5vKuEACdHkfvuZeTdT8MmMmNpgY1O/t6
7PwAn1tk+uJ9czNa+MBWQWP4vndzN+Et
=FIKF
-----END PGP SIGNATURE-----
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi,
Effectively immediately we are discontinuing support for the jobserver (that
is, the "job" command) on willow. The replacement for the jobserver is SGE:
<https://wiki.toolserver.org/view/Job_scheduling>
If you current use the job server, please migrate your jobs to SGE and then
delete them. We will not shut down the job server until all users have
migrated.
- river.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (FreeBSD)
iEYEARECAAYFAk0lIyIACgkQIXd7fCuc5vLYxQCgkpBdrvdYiCBDe/4QR2Xx4tDU
K/AAn1LeTo77idvq4jYB72HbNeqrSwor
=je9C
-----END PGP SIGNATURE-----
Hi, it looks like the user-store is completely full:
>df
hemlock:/aux0/user-store
3904398336 3904398336 0 100% /mnt/user-store
It requires cleaning and sorting (especially the dumps that are all
over the place), but I especially wonder what is taking so much place
?
I guess I'll have to use my home quota for now.
Darkdadaah