Esempio n. 1
0
        config.add_section(safe_name)

        directory = '%s/%s' % (topdir,d)
        if opts.tier:
            directory = os.path.join(directory,opts.tier)
        directory = directory.replace('//','/')

        config.set(safe_name,'CMSSW.datasetpath',d)
        lfn = castortools.castorToLFN(directory)
        config.set(safe_name,'USER.user_remote_dir',lfn)
        output_dirs.append(lfn)
        
        #create the directory on EOS
        if not castortools.fileExists(directory):
            castortools.createCastorDir(directory)
            castortools.chmod(directory,'775')
        if not castortools.isDirectory(directory): 
            raise Exception("Dataset directory '%s' does not exist or could not be created" % directory)
        
    config.write(file(opts.output,'wb'))

    from logger import logger
    logDir = 'Logger'
    os.mkdir(logDir)
    log = logger( logDir )
    log.logCMSSW()
    log.addFile( os.path.join( os.getcwd(), opts.cfg) )
    log.addFile( os.path.join( os.getcwd(), opts.output) )

    for d in output_dirs:
        log.stageOut(d)
Esempio n. 2
0
        config.add_section(safe_name)

        directory = '%s/%s' % (topdir, d)
        if opts.tier:
            directory = os.path.join(directory, opts.tier)
        directory = directory.replace('//', '/')

        config.set(safe_name, 'CMSSW.datasetpath', d)
        lfn = castortools.castorToLFN(directory)
        config.set(safe_name, 'USER.user_remote_dir', lfn)
        output_dirs.append(lfn)

        #create the directory on EOS
        if not castortools.fileExists(directory):
            castortools.createCastorDir(directory)
            castortools.chmod(directory, '775')
        if not castortools.isDirectory(directory):
            raise Exception(
                "Dataset directory '%s' does not exist or could not be created"
                % directory)

    config.write(file(opts.output, 'wb'))

    from logger import logger
    logDir = 'Logger'
    os.mkdir(logDir)
    log = logger(logDir)
    log.logCMSSW()
    log.addFile(os.path.join(os.getcwd(), opts.cfg))
    log.addFile(os.path.join(os.getcwd(), opts.output))
Esempio n. 3
0
# preparing castor dir -----------------

import castorBaseDir
cdir = castortools.lfnToCastor( castorBaseDir.castorBaseDir(user=options.user) )
cdir += sampleNameDir

if castortools.isCastorFile( cdir ) and not options.force:
    print 'The destination castor directory already exists:'
    print cdir
    print 'Please check. If everything is fine, run again with the -f option.'
    sys.exit(1)

rfmkdir = 'rfmkdir -m 775 -p ' + cdir
print rfmkdir
castortools.createCastorDir(cdir)
castortools.chmod(cdir, '775')

# making local crab directory ---------
ldir = '.' + sampleNameDir

mkdir = 'mkdir -p ' + ldir
print mkdir
os.system( mkdir )

#cpcrab = 'cp crab.cfg %s/crab.cfg' % ldir
#print cpcrab
#os.system( cpcrab )

#prepare the crab file
newCrabPath = '%s/crab.cfg' % ldir
print newCrabPath
Esempio n. 4
0
# preparing castor dir -----------------

import castorBaseDir
cdir = castortools.lfnToCastor(castorBaseDir.castorBaseDir(user=options.user))
cdir += sampleNameDir

if castortools.isCastorFile(cdir) and not options.force:
    print 'The destination castor directory already exists:'
    print cdir
    print 'Please check. If everything is fine, run again with the -f option.'
    sys.exit(1)

rfmkdir = 'rfmkdir -m 775 -p ' + cdir
print rfmkdir
castortools.createCastorDir(cdir)
castortools.chmod(cdir, '775')

# making local crab directory ---------
ldir = '.' + sampleNameDir

mkdir = 'mkdir -p ' + ldir
print mkdir
os.system(mkdir)

#cpcrab = 'cp crab.cfg %s/crab.cfg' % ldir
#print cpcrab
#os.system( cpcrab )

#prepare the crab file
newCrabPath = '%s/crab.cfg' % ldir
print newCrabPath