Hello...thanks to several individuals, I've been able to get a little
farther in this Opsware global shell script:
#!/usr/bin/python
import os
outfile = open('test.txt','w')
for servername in os.listdir('/opsw/Server/@'):
print '---', servername
print >> outfile, '---', servername
rosh
"Kayvan Sarikhani" wrote
For the record, $LOGNAME works fine as a variable...it's a standard
env
variable in Linux to display the current user's username.
In that case os.getenv('LOGNAME') should retrieve it for you
HTH,
--
Alan Gauld
Author of the Learn to Program web site
http://www.al
On Wed, Jan 7, 2009 at 5:09 PM, Sander Sweers wrote:
> On Wed, Jan 7, 2009 at 22:04, Kayvan Sarikhani
> wrote:
> >
> > This is of course not a Python error, but as you might guess from looking
> at
> > the script, the whole $SERVER_NAME piece is probably wrong.
>
> Indeed the variables are wrong
On Wed, Jan 7, 2009 at 4:57 PM, spir wrote:
> Le Wed, 7 Jan 2009 16:04:28 -0500,
> "Kayvan Sarikhani" a écrit :
>
> > #!/bin/bash
> > #
> > # This script checks the dates on all managed systems.
> > OUTFILE="/home/ksarikhani/public/bin/timecheck.txt"
> > rm -f $OUTFILE
> > cd "/opsw/Server/@/"
>
On Wed, Jan 7, 2009 at 22:04, Kayvan Sarikhani wrote:
> #!/usr/bin/python
> import os, sys
> sys.stdout = open('timecheck.txt','w')
> for servername in os.listdir('/opsw/Server/@'):
> print '---', servername
> os.system('rosh -n $SERVER_NAME -l $LOGNAME')
> os.system('date')
> sys.stdo
Hi there...I'm new to Python scripting, with maybe 3 days under my belt thus
far. Besides the occasional shell script, the last time I ever touched a
programming language was probably at least 12 years ago, if that gives you
any indication of my experience. :)
I don't know if this is the proper pl