This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| castor:transferzh [2009/03/20 11:18] – decianm | castor:transferzh [2014/02/05 15:26] (current) – [How to] nchiap | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Copying Files from CASTOR to Zuerich directly ====== | ====== Copying Files from CASTOR to Zuerich directly ====== | ||
| + | ** Note: ** [[grid: | ||
| + | |||
| ===== How to ===== | ===== How to ===== | ||
| - | In order to copy files directly from CASTOR to a machine in Zurich, | + | In order to copy files directly from CASTOR to a machine in Zurich, |
| < | < | ||
| - | export LHCBPRODROOT=/ | + | lhcb-proxy-init |
| - | . ${LHCBPRODROOT}/ | + | |
| - | . ${LHCBPRODROOT}/ | + | |
| - | export X509_CERT_DIR=/ | + | |
| - | grid-proxy-init | + | |
| </ | </ | ||
| - | which will prepare | + | which will prepare for file-transport. |
| Then do (e.g.): | Then do (e.g.): | ||
| < | < | ||
| Line 17: | Line 15: | ||
| ** Note: ** You need a Grid Certificate to do this! | ** Note: ** You need a Grid Certificate to do this! | ||
| + | |||
| + | |||
| + | ===== Multi-File Loop ===== | ||
| + | If you want to transfer several files, Create a file containing a list like this | ||
| + | <file txt files.txt> | ||
| + | / | ||
| + | / | ||
| + | </ | ||
| + | |||
| + | Now you can use the following one-liner to get all the files | ||
| + | <code bash> | ||
| + | for f in `cat files.txt`; do lcg-cp -v srm:// | ||
| + | </ | ||
| + | '' | ||
| ===== Transfer with a Script ===== | ===== Transfer with a Script ===== | ||
| Line 22: | Line 34: | ||
| The script can be used the following way: | The script can be used the following way: | ||
| * Open a new shell (it's always a good idea to open a new shell for transfers) | * Open a new shell (it's always a good idea to open a new shell for transfers) | ||
| - | * Type '' | + | * Type |
| - | * Type '' | + | < |
| + | castortrans -i | ||
| + | </ | ||
| + | This will set up your Grid environment. | ||
| + | * Type | ||
| + | < | ||
| + | </ | ||
| + | . If you have the same username at CERN as locally in Zurich, yourFileOnCastor will be the path starting in your home-directory on CASTOR. yourDestinationFile will start in your home-directory in Zurich. If your usernames are not identical in Zurich and at CERN, you have to set them manually in the script. | ||
| * The script has been tested on a z-shell. As it is sourced and not only executed, it can not be guaranteed to work with all the other settings (hence the new shell). | * The script has been tested on a z-shell. As it is sourced and not only executed, it can not be guaranteed to work with all the other settings (hence the new shell). | ||
| - | ====== | + | ===== Transfer with an automated Script |
| + | If you have several files to download, you can use the script '' | ||
| + | The script can be used similarly to castortrans: | ||
| + | * Open a new shell (it's always a good idea to open a new shell for transfers) | ||
| + | * Type | ||
| + | < | ||
| + | multiplecastortrans -i | ||
| + | </ | ||
| + | This will set up your Grid environment. | ||
| + | * Type | ||
| + | < | ||
| + | </ | ||
| + | With < | ||
| + | @COUNTER$ | ||
| + | </ | ||
| + | you can add a counter in the path, for example. | ||
| + | < | ||
| + | multiplecastortrans -f / | ||
| + | </ | ||
| + | will download the files from the directories | ||
| + | < | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | </ | ||