From mboxrd@z Thu Jan 1 00:00:00 1970 From: Benda Xu Subject: remote plot with local output? Date: Tue, 15 Sep 2015 00:11:03 +0900 Message-ID: <87bnd5gho8.fsf@gentoo.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50576) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZbVPZ-00074b-1v for emacs-orgmode@gnu.org; Mon, 14 Sep 2015 11:11:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZbVPV-0003jC-73 for emacs-orgmode@gnu.org; Mon, 14 Sep 2015 11:11:16 -0400 Received: from smtp.gentoo.org ([140.211.166.183]:55806) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZbVPU-0003h4-Si for emacs-orgmode@gnu.org; Mon, 14 Sep 2015 11:11:13 -0400 Received: from x2 (p212068.mirai.ne.jp [210.172.212.68]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: heroxbd) by smtp.gentoo.org (Postfix) with ESMTPSA id 9F9543409EC for ; Mon, 14 Sep 2015 15:11:09 +0000 (UTC) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Dear All, I am looking for a way to configure org-babel so that a program runs remotely and outputs locally. An example is #+NAME: line | 1 | | 2 | | 3 | #+BEGIN_SRC python :results file :var dt=line :dir /ipmuap02:/tmp from matplotlib import pylab as plt plt.plot(dt) plt.savefig("line.png") return "line.png" #+END_SRC #+RESULTS: [[file:/scp:ipmuap02:/tmp/line.png]] I would like to embed this figure into my note. The example above need to fetch the figure from the remote host on each exportation, which is very sensitive to the network environment. I cannot make the plot locally, because (unlike the over-simplified example) some potentially big data are only available remotely. My solution is to cache the result (:cache yes), execute the code block, copy the output file to localhost, update the #+RESULTS link to the local one, manually. Now I am facing many such tasks and feel like automating that. What is the recommended way for copying the file output from an remote execution code block back to localhost? BTW, my org-mode is 8.3.1 and emacs is 24.4.1. Cheers, Benda