HOWTO copy a file from the ifarm to home

From GlueXWiki
Revision as of 19:48, 9 April 2021 by Marki (Talk | contribs) (Created page with "Let us assume that you want to copy the file /cache/halld/RunPeriod-2017-01/analysis/ver44/tree_pi0pippimeta__B5_M7_M17/merged/tree_pi0pippimeta__B5_M7_M17_030648.root from...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Let us assume that you want to copy the file


from the lab to home. For this example we start with a shell variable definition to save typing:


We will assume bash throughout. You will also need a port number, something random between 10000[?] and 65000[?]. We will choose


The randomness is to avoid conflicts with other users. And let us assume your JLab username is


1. Set up an ssh tunnel

ssh -t -L${port}:localhost:${port} $ ssh -t -L${port}:localhost:22 ifarm

you will have to type your JLab password twice (unless you are using an ssh agent).

2. Use the tunnel to copy the file

scp -P$port localhost:$file .

to copy to the current working directory.