# ./collect script

#--- "Copying files \"probes.N\" from nodes ---

echo "Must I copy files \"probes.N\" from nodes to master node (y/n)?"
read responce

case $responce in
   y) echo "Copying files \"probes.N\" from nodes..."
      rcp root@node1:/home/andrei/mpi_layer2/probes.1  probes.1
      rcp root@node2:/home/andrei/mpi_layer2/probes.2  probes.2
      rcp root@node3:/home/andrei/mpi_layer2/probes.3  probes.3
      rcp root@node4:/home/andrei/mpi_layer2/probes.4  probes.4;;
    *) echo "Leaving now";;
esac

#--- Copying files \"backup.N\" from nodes ---

echo "Must I copy files \"backup.N\" from nodes to master node (y/n)?"
read responce

case $responce in
   y) echo "Copying files \"backup.N\" files from nodes..."
      rcp root@node1:/home/andrei/mpi_layer2/backup.1  backup.1
      rcp root@node2:/home/andrei/mpi_layer2/backup.2  backup.2
      rcp root@node3:/home/andrei/mpi_layer2/backup.3  backup.3
      rcp root@node4:/home/andrei/mpi_layer2/backup.4  backup.4;;
   *) echo "Leaving now";;
esac


#--- Deleting files \"probes.N\" files from nodes ---

echo "Must I DELETE \"probes.N\" from nodes (y/n)?"
read responce

case $responce in
   y) rsh node1 rm -f /home/andrei/mpi_layer2/probes.1
      rsh node2 rm -f /home/andrei/mpi_layer2/probes.2
      rsh node3 rm -f /home/andrei/mpi_layer2/probes.3
      rsh node4 rm -f /home/andrei/mpi_layer2/probes.4;;
   *) echo "Leaving now";;
esac

#--- end of ./collect ---