If my understanding of what you're wanting is incorrect; let me know. A long time ago, I had 2 computers with a shared NFS drive. I used MPI (parallel computing) to instruct both computers when to do what program but I think that may be a bit too advanced for what you're wanting. Here are some other options:
- When P1 is finished, have it 'touch' a file on the net drive; have a simple perl script run on P2 all the time to check if the file exists. Might want to add a sleep in to pause the checking.
(like this:
#!/usr/bin/perl
$fname = "p1-ready";
$net_dir = "/mnt/nfs-mount/";
$f = $net_dir . $fname;
while (1) {
if (-e $f) {
#do something
}
}
or you could have a script that runs in cron that checks for the file from P1 and if it finds it, start the next program. Hope this helps.
EDIT:
Just thought of another way; assuming the script/program on P1 is called "P1app" and on P2 is "P2app". Run ssh-keygen on both computers; leaving nothing for a password (just hit enter) then copy .ssh/id_rsa.pub from P1 to P2 and type "cat id_rsa.pub >> ~/.ssh/authorized_keys" and do the reverse on P2 to P1. This will allow that user to ssh from P1 to P2 w/o needing to enter a password.
Next, have a shell script on P1:
/usr/local/bin/P1app && ssh -l USER_ON_P2 P2_IP P2app
What this does is start P1app and if it finished ok (the && means the second part won't execute unless the P1app ran without issues) it will then start P2app via a ssh.