PnfsScripts
Jump to navigation
Jump to search
first use:
./listFilesInDirectory.py lists all files in a directory and their pnfsid and the pool they reside on Mandatory options: --directory= : directory to investigate Optional: --pool= : show only files that match the pool regexp -h, --help : print this help message
example use:
./listFilesInDirectory.py --directory=/pnfs/iihe/cms/store/user/gvonsem/Skimmed-TopTrees/VLQ_MuonSkim_53X_v5_DataTopTreeId3446_Run2012C-22Jan2013-v1/13072013_122423/ files in /pnfs/iihe/cms/store/user/gvonsem/Skimmed-TopTrees/VLQ_MuonSkim_53X_v5_DataTopTreeId3446_Run2012C-22Jan2013-v1/13072013_122423/: TopTree_Skimmed_278.root 00110000000000000CE4CF68 behar082_5 TopTree_Skimmed_172.root 00110000000000000CE48570 behar030_1 TopTree_Skimmed_244.root 00110000000000000CE4B708 behar070_2 TopTree_Skimmed_316.root 00110000000000000CE4E340 behar070_2 skim.xml 00110000000000000CE35DD8 behar080_2 TopTree_Skimmed_24.root 00110000000000000CE37E40 behar033_1 TopTree_Skimmed_197.root 00110000000000000CE49288 behar080_2 TopTree_Skimmed_210.root 00110000000000000CE49FD0 behar082_3 TopTree_Skimmed_269.root 00110000000000000CE4C680 behar082_2
and:
./listFilesInDirectory.py --directory=/pnfs/iihe/cms/store/user/gvonsem/Skimmed-TopTrees/VLQ_MuonSkim_53X_v5_DataTopTreeId3446_Run2012C-22Jan2013-v1/13072013_122423/ --pool=behar034 files in /pnfs/iihe/cms/store/user/gvonsem/Skimmed-TopTrees/VLQ_MuonSkim_53X_v5_DataTopTreeId3446_Run2012C-22Jan2013-v1/13072013_122423/: TopTree_Skimmed_387.root 00110000000000000CE51548 behar034_2 TopTree_Skimmed_400.root 00110000000000000CE52130 behar034_2 TopTree_Skimmed_416.root 00110000000000000CE52B70 behar034_2 TopTree_Skimmed_297.root 00110000000000000CE4DB20 behar034_2 TopTree_Skimmed_310.root 00110000000000000CE4DE70 behar034_1 TopTree_Skimmed_191.root 00110000000000000CE49268 behar034_2
This script also creates the file "selectedFiles" containing all the files in the directory.
It also shows the pnfsid and the pool the file resides on.
You can select only the files in pools matching a certain pattern by adding the --pool= option.
The resulting files are also written to the "selectedFiles" file.
this file can then be used as input for the next script to move them to a different pool.
./move_files_to_different_pool.py Mandatory options: --destination : destination pool --file : file to be moved OR --fileList : file contining list of files to be moved Optional: -h, --help : print this help message
example use:
./move_files_to_different_pool.py --fileList=selectedFiles --destination=behar080_2 Will move 00110000000000000CE35DD8 from behar034_2 to behar080_2 [maite.iihe.ac.be] (local) admin > cd behar034_2 [maite.iihe.ac.be] (behar034_2) admin > migration move -pnfsid=00110000000000000CE35DD8 behar080_2 [2] INITIALIZING migration move -pnfsid=00110000000000000CE35DD8 -- behar080_2