Search code examples
emacsorg-modetransfertramp

How to transfer files with Tramp using scp or rsync


I've read the TRAMP manual and dozens of forums across the web but I couldn't find an answer to this question. I am trying to set up a link in org-mode that transfers a file from a remote server to my local machine (or vice-versa). According to the manual I have to write something like /scp:user@host:filepathonremotemachine and that's it. No specification of where the file should be moved to, which is weird. I've tried to do it this way and it simply opened the file (as if I was using ssh); tried other combinations also, without any luck. There is a specific reason for why I am trying to do this with tramp and not a shell:command link. Any help is very welcome

UPDATE Apparently TRAMP is less useful than what it promises. That leaves me with the shell:command link option. The problem then revolves around avoiding the openssh window that pops out. The closest solution I found was here and it resumes to setting up an ssh-agent. I am not very familiar with this procedure and I would prefer to use the authinfo.gpg authentication method. Do I have this option? Thanks.


Solution

  • Tramp itself offers just alternative implementations of native Emeacs functions. In this sense, it is dumb, as every library, because it doesn't know what the caller wants.

    I'm not an org-mode specialist, but could you please show, which kind of link you have in mind? Without any remoteness, just a link which copies a file locally. Replacing local file names with remote ones will be easy then.

    I assume, you need something like an external link, evaluating Lisp code. Like

     elisp:(copy-file "/path/src" "/path/target")