#!/bin/csh #$Id$ # # Purpose: # copies directory trees to another machine # # Examples: # # to copy from here to another machine # # scp-proc-to-proc dim.dat $nor52/pencil-code/axel/forced/kf8_helical/512_kf3_Pm20c . # scp-proc-to-proc dim.dat $tri/pencil-code/axel/forced/LSrot/256om0a . # scp-proc-to-proc dim.dat $nor52/pencil-code/hubbard/eikonal/3d/576x576x192o . # # to copy from another machine to here # # scp-proc-to-proc dim.dat . $dcsc/pencil-code/axel/MRIexp/128d # scp-proc-to-proc dim.dat . $neo/pencil-code/simon/forced/alpha2_periodic/512_kf20_sig010 # will copy all var.dat files from current directory to var.dat in # another run directory. # Used for restarting in a different directory. # Added 4th argument for skipping over $skip counts if ($#argv == 4) then set skip=$4 else set skip=0 endif # set counter set counter="1" set procdirs = `ls data | grep proc ` foreach proc ($procdirs) if ( $counter >= $skip ) then # create subdirectories proc*, no message if already existing nohup ssh $2:s/:/ mkdir //data/$proc >& /dev/null echo "scp $3/data/$proc/$1 $2/data/$proc" nohup scp $3/data/$proc/$1 $2/data/$proc & sleep .2 endif set counter = `expr $counter + 1` echo "counter=$counter" end