[Tutor] How to do it ???

Sere Gerrit gerrit.sere@lin.vlaanderen.be
Fri, 22 Oct 1999 12:31:55 +0200


Hi,

I have the following problem. I want to go to another server (info). On
that server there are a lot of users. I want to check if they use there
home directory's. For doing this I need root account. How must I program
this ?? Is it possible to give an example (little) ??


#! /usr/bin/python

import os

# search users on server  linfo

lijst_gebruikers = os.popen("rsh linfo ls /export/home").readlines()

commando = "rsh linfo find /export/home/"

for pipo in lijst_gebruikers:
  voeruit =  commando + pipo + "-mtime -60"
  lijst = os.popen(commando).readlines()
  print pipo,len(lijst)

Thankx,