Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Copying files to a local machine

file_copy_20222024_DECMAR_2007.zip

Using scp over multiple nodes is painful. This is a small script that does the job:

  1. Log onto the control server using ssh with remote port forwarding:
    ssh smeuren@fastx3.slac.stanford.edu -Y -R 40000:localhost:40000
    ssh smeuren@mcclogin -Y -R 40000:localhost:40000
    ssh fphysics@facet-srv20  -Y -R 40000:localhost:40000
  2. Start the server script
    bash
    source $PACKAGE_TOP/anaconda/envs/python3.7env/bin/activate
    python3 ./smeuren/remote.py 40000
  3. Open a different ssh connection to browse the file system, identify file you want to copy
  4. Call the local script to download this file
    python3 local.py 40000 "/u1/facet/matlab/data/2022/2022-12/2022-12-17/ProfMon-CAMR_LI20_307-2022-12-17-180157.mat"
  5. on your local computer
  6. Run the client script on the control computer and send a file outside

Synchronizing source code from a local machine with a server

2024_MAY_18_folder_update.zip

  • create an ssh port tunnel to the control network (see above)
  • run local.py in a local folder that contains files that should be transferred to the server
  • run remote.py in a folder on the server (ATTENTION: it will overwrite files)

Executing wget remotely