CMS 3D CMS Logo

Functions | Variables
producerFileCleanner Namespace Reference

Functions

def getDirSize (path)
 
def getDiskUsage (path)
 
def logme (msg, args)
 
def sendmail (body="Hello from producerFileCleanner", subject="Hello!")
 

Variables

 aDelQuota
 
 COLLECTDIR
 
 delQuota
 
 destDir
 
 DIR_LIST
 
 diskPUsage
 
 diskSize
 
 diskUsed
 
 doneSize
 
 EMAIL
 
 EMAILINTERVAL
 
 EXEDIR
 
 FILE_LIST
 
 files
 
 fMatch
 
 fullFName
 
 fullSdName
 
 HOSTNAME
 
 key
 
 lastEmailSent
 
 msg
 
 now
 
 ORIGINALDONEDIR
 
 PRODUCER_DU_BOT
 
 PRODUCER_DU_TOP
 
 quota
 
 reverse
 
 run
 
 SENDMAIL
 
 stdout
 
 STOP_FILE
 
 subSystem
 
 TFILEDONEDIR
 
 TMP_LIST
 
 topdown
 
 True
 
 userAvailable
 
 WAITTIME
 

Function Documentation

def producerFileCleanner.getDirSize (   path)

Definition at line 41 of file producerFileCleanner.py.

41 def getDirSize(path):
42  import stat
43  size=os.stat(path).st_blksize
44  for directory,subdirs,files in os.walk(path):
45  dStats=os.lstat(directory)
46  size+=(dStats[stat.ST_NLINK]-1)*dStats[stat.ST_SIZE]
47  for f in files:
48  fStats=os.lstat("%s/%s" % (directory,f))
49  fSize=fStats[stat.ST_SIZE]
50  size+=fSize
51 
52  return size
53 
def producerFileCleanner.getDiskUsage (   path)

Definition at line 33 of file producerFileCleanner.py.

References dqmMemoryStats.float.

33 def getDiskUsage(path):
34  fsStats=os.statvfs(path)
35  size=fsStats.f_bsize*fsStats.f_blocks
36  available=fsStats.f_bavail*fsStats.f_bsize
37  used=size-available
38  usedPer=float(used)/size
39  return (size,available,used,usedPer)
40 
def producerFileCleanner.logme (   msg,
  args 
)

Definition at line 29 of file producerFileCleanner.py.

References edm.print().

Referenced by sendmail().

29 def logme(msg, *args):
30  procid = "[%s/%d]" % (__file__.rsplit("/", 1)[-1], os.getpid())
31  print(datetime.now(), procid, msg % args)
32 
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:66
def producerFileCleanner.sendmail (   body = "Hello from producerFileCleanner",
  subject = "Hello!" 
)

Definition at line 54 of file producerFileCleanner.py.

References logme().

54 def sendmail(body="Hello from producerFileCleanner",subject= "Hello!"):
55  scall = Popen("%s -t" % SENDMAIL, shell=True, stdin=PIPE)
56  scall.stdin.write("To: %s\n" % EMAIL)
57  scall.stdin.write("Subject: producerFileCleaner problem on server %s\n" %
58  HOSTNAME)
59  scall.stdin.write("\n") # blank line separating headers from body
60  scall.stdin.write("%s\n" % body)
61  scall.stdin.close()
62  rc = scall.wait()
63  if rc != 0:
64  logme("ERROR: Sendmail exit with status %s", rc)
65 
66 # --------------------------------------------------------------------
def sendmail(body="Hello from producerFileCleanner", subject="Hello!")

Variable Documentation

producerFileCleanner.aDelQuota

Definition at line 102 of file producerFileCleanner.py.

producerFileCleanner.COLLECTDIR

Definition at line 12 of file producerFileCleanner.py.

producerFileCleanner.delQuota

Definition at line 88 of file producerFileCleanner.py.

producerFileCleanner.destDir

Definition at line 111 of file producerFileCleanner.py.

producerFileCleanner.DIR_LIST

Definition at line 168 of file producerFileCleanner.py.

producerFileCleanner.diskPUsage

Definition at line 76 of file producerFileCleanner.py.

producerFileCleanner.diskSize

Definition at line 76 of file producerFileCleanner.py.

producerFileCleanner.diskUsed

Definition at line 76 of file producerFileCleanner.py.

producerFileCleanner.doneSize

Definition at line 75 of file producerFileCleanner.py.

producerFileCleanner.EMAIL

Definition at line 10 of file producerFileCleanner.py.

producerFileCleanner.EMAILINTERVAL

Definition at line 19 of file producerFileCleanner.py.

producerFileCleanner.EXEDIR

Definition at line 22 of file producerFileCleanner.py.

producerFileCleanner.FILE_LIST

Definition at line 103 of file producerFileCleanner.py.

producerFileCleanner.files

Definition at line 106 of file producerFileCleanner.py.

producerFileCleanner.fMatch

Definition at line 107 of file producerFileCleanner.py.

producerFileCleanner.fullFName

Definition at line 112 of file producerFileCleanner.py.

producerFileCleanner.fullSdName

Definition at line 134 of file producerFileCleanner.py.

producerFileCleanner.HOSTNAME

Definition at line 21 of file producerFileCleanner.py.

producerFileCleanner.key

Definition at line 106 of file producerFileCleanner.py.

producerFileCleanner.lastEmailSent

Definition at line 26 of file producerFileCleanner.py.

producerFileCleanner.msg

Definition at line 92 of file producerFileCleanner.py.

producerFileCleanner.now

Definition at line 90 of file producerFileCleanner.py.

producerFileCleanner.ORIGINALDONEDIR

Definition at line 13 of file producerFileCleanner.py.

producerFileCleanner.PRODUCER_DU_BOT

Definition at line 17 of file producerFileCleanner.py.

producerFileCleanner.PRODUCER_DU_TOP

Definition at line 16 of file producerFileCleanner.py.

producerFileCleanner.quota

Definition at line 87 of file producerFileCleanner.py.

producerFileCleanner.reverse

Definition at line 163 of file producerFileCleanner.py.

producerFileCleanner.run

Definition at line 110 of file producerFileCleanner.py.

producerFileCleanner.SENDMAIL

Definition at line 20 of file producerFileCleanner.py.

producerFileCleanner.stdout

Definition at line 8 of file producerFileCleanner.py.

producerFileCleanner.STOP_FILE

Definition at line 23 of file producerFileCleanner.py.

producerFileCleanner.subSystem

Definition at line 109 of file producerFileCleanner.py.

producerFileCleanner.TFILEDONEDIR

Definition at line 11 of file producerFileCleanner.py.

producerFileCleanner.TMP_LIST

Definition at line 162 of file producerFileCleanner.py.

producerFileCleanner.topdown

Definition at line 135 of file producerFileCleanner.py.

producerFileCleanner.True

Definition at line 163 of file producerFileCleanner.py.

producerFileCleanner.userAvailable

Definition at line 76 of file producerFileCleanner.py.

producerFileCleanner.WAITTIME

Definition at line 18 of file producerFileCleanner.py.