CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions
copyFromCastor Namespace Reference

Functions

def main
 

Function Documentation

def copyFromCastor.main ( )

Definition at line 4 of file copyFromCastor.py.

References CommonMethods.cp(), cmsRelvalreport.exit, and python.rootplot.utilities.ls().

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