LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Lazy Man's scp? (https://www.linuxquestions.org/questions/linux-newbie-8/lazy-mans-scp-718641/)

PoopLoops 04-12-2009 02:22 PM

Lazy Man's scp?
 
I do a lot of up/downloading to/from my school's computer network from my laptop and desktop so that I can work on my stuff anywhere and so that I have a secure (as in it won't crap out on me) place to store large files (emailing myself the files is tedious).

But scp is kind of annoying to use because I have a lot of folders and subdirectories that I use, mainly for having different versions of code that I write, so lots of similar names and junk. What I usually do is ssh, find the file(s) I want to download, and then exit, and scp to that directory, where the terminal still displays my ssh session so I know where to go. Yeah, that works, but is there an easier way to just be logged in remotely and copy things over to the computer I'm on at the time? The caveat is that it can be *any* computer with ssh, so I won't always know my IP, and also, I don't like having to remember so many addresses/IP's. :P

Or at least, is there a way I could write a script that would do this for me? It would make it easier on my PC and laptop, at least.

Thanks. :D

acid_kewpie 04-12-2009 02:45 PM

note really clear on what you want to achieve, but sftp will give you an ftp login environment not a single shot command.

PoopLoops 04-12-2009 02:56 PM

Let me explain what I do now:

ssh blah@schoolPC
*look around for the file I want*
exit
scp blah@schoolPC:-/filepath/ ~/destinationpath/
-----------

What I would like:

ssch blah@schoolPC
*look around for the file I want*
COPY this file to ~/destinatoinpath/ on my current PC
----------------

The reason this is a big deal for me is because scp doesn't have auto-complete for the remote computer, because I don't log in until I input the command. So with a long file path, it's annoying to have to type all this out, and also there is a decent chance of a typo somewhere.

acid_kewpie 04-12-2009 03:14 PM

as above, sftp.

mrclisdue 04-12-2009 03:52 PM

There's sshfs, a cousin to sftp, using fuse.

These two links should elaborate and help you set it up - it's a snap.

http://fuse.sourceforge.net/sshfs.html
http://www.linuxjournal.com/article/8904

cheers,

PoopLoops 04-12-2009 03:53 PM

Cool, thanks. :)

hw-tph 04-12-2009 04:30 PM

The most obvious solution, in my humble opinion, is to use rsync over ssh to keep your working copies up to date. Using a version control system like subversion or cvs would also be a possible solution but probably over the top.

Using rsync is really effective since it will only transfer changed files, making it possible to keep up to date copies of your stuff (be it code, configuration files or documents) on different computers with no hazzle. If you run it over ssh (it's as simple as adding -e ssh) you will have secure transfers too. No hazzle, no problem.


All times are GMT -5. The time now is 12:58 AM.