Skip to content

Tips

Author: R. Bordas bordasraph@gmail.com

How to set up an SSH key?

  1. ssh-keygen -t rsa -b 4096 -C 'raphael.bordas@cea.fr’
  2. ssh-copy-id -i ./id_rsa.pub narval

    ssh-copy-id -i ./id_rsa.pub alambic

    etc.

How to launch headless jobs?

⇒ Use nohup

# Solution 1 
rm logs/burst_time_ccf.log # nohup does not allow overwriting log files
nohup Rscript burst_time_cross_correlation.R > logs/burst_time_ccf.log 2>&1 &

# Solution 2: add datetime in log file name
nohup Rscript burst_time_cross_correlation.R > logs/burst_time_ccf_$(date +%Y-%m-%d_%H-%M-%S).log 2>&1 &

# Check if the job is still running
ps -ef | grep Rscript

How to use rsync to synchronize files over ssh

rsync -rltDh --progress --include='*/' --include='include-pattern' --exclude='**' /absolute/source/path/ /absolute/target/path

And add --dry-run to see what it will do.

How to check the workload on a shared stations?

# iterating over all stations
for station in calmar narval cachalot nautilus beluga; 
do echo === $station ===; ssh ${station}.intra.cea.fr /usr/bin/w; 
done

# once logged in one station
who # who has job running
htop # what resources are available