Ryan Saxe
Ryan Saxe

Reputation: 17829

update file on ssh and link to local computer

I may be being ignorant here, but I have been researching for the past 30 minutes and have not found how to do this. I was uploading a bunch of files to my server, and then, prior to them all finishing, I edited one of those files. How can I update the file on the server to the file on my local computer?

Bonus points if you tell me how I can link the file on my local computer to auto update on the server when I connect (if possible of course)

Upvotes: 0

Views: 3928

Answers (3)

evotion
evotion

Reputation: 365

Just use scp and copy the file back. scp [user]@[address]:/[remotepath]/[remotefile] [localfolder] if you want to copy the file on the server back to your local machine or scp [localfolder]/[filename] [user]@[address]:/[remotepath] in case you want to copy the file again to the server. The elements in [] have to be exchanged with actual paths and or file names. On the remote it has to be the absolute path and on the local machine it can be absolute or relative.More information on scp

This of course means that the destination file will be overwritten.

Maybe rsync would be an option. It is capable to synchronize different folders. rsync can be used to sync folders over the network and is capable to be combined with ssh.

Upvotes: 2

Skiaddict
Skiaddict

Reputation: 48

I don't know your local computer OS, but if it is Linux or OSX, you can consider LFTP. This is an FTP client which supports SFTP://. This client has the "mirror" functionality. With a single command you can mirror your local files against a server.

Note: what you need is a reverse mirror. in LFTP this is mirror -r

Upvotes: 0

locohamster
locohamster

Reputation: 117

Have you considered Dropbox or SVN ?

Upvotes: 0

Related Questions