CMS 3D CMS Logo

Functions
copyFromCastor Namespace Reference

Functions

def main ()
 

Function Documentation

◆ main()

def copyFromCastor.main ( )

Definition at line 4 of file copyFromCastor.py.

References beamvalidation.exit(), and relval_nano.ls.

4 def main():
5  if len(sys.argv) < 3:
6  error = "Usage: cpFromCastor fromDir toDir (optional filter)"
7  exit(error)
8  user = os.getenv("USER")
9  castorDir = "/castor/cern.ch/cms/store/caf/user/" + user + "/" + sys.argv[1] + "/"
10  filter = ""
11  if len(sys.argv) > 3:
12  filter = sys.argv[3]
13  fileList = ls(castorDir,filter)
14  destDir = sys.argv[2]
15  copiedFiles = cp(castorDir,destDir,fileList)
16 
17  if len(copiedFiles) != len(fileList):
18  error = "ERROR: I couldn't copy all files from castor"
19  exit(error)
20 
def exit(msg="")