CMS 3D CMS Logo

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

Functions

def main
 

Function Documentation

def copyFromCastor.main ( )

Definition at line 4 of file copyFromCastor.py.

References beamvalidation.exit(), and eostools.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)
def ls
Definition: eostools.py:349