Hi all,

This thread needs another tweaky suggestion like a fish needs a bicycle, but...

<digression>

I realized Puneet's premise included not using unix-based editors... however in the 
interest of completeness, let's mention... if you use emacs there are are two 
convenient ways to edit remote files.

1) ssh -t emacs <path>  (connects you to emacs on the remote machine; edit away; when 
done, you'll be back.  If keys are exchanged, there's no passwd prompt.)  (this also 
works with other Unix-based editors.)

2) I understand that emacs has some other way that it can remotely connect to files 
via SSH and edit them as if they were local; you can even mix local and non-local 
buffers (hence move content between them etc.)  Never done this myself.  Again, 
key-exchange will make it smoother.

As you can tell, I use & advocate emacs.  :-)

</digression>

However, I'm personally fairly convinced that neither of the above is really the right 
solution.  I prefer to edit a local copy of the files, test locally when possible, and 
then use rsync with ssh and key exchange to incrementally push the changes whenever I 
like, which is generally very often -- sometimes many times per hour or even several 
per minute during debugging.

This last method has helped me work in a number of soda-straw environments 
(impoverished access to editors or shell feathres on client's target machine), and is 
editor-independent: use whatever editors you want -- Photoshop for images, BBEdit for 
text files, whatever -- all locally.

Personally, I use rsync dozens to hundreds of times per day for various archiving, 
diffing, and transferring tasks.  (If you've got the command line a couple of 
keystrokes away, you can retrieve and re-run your synch command in a couple more 
keystrokes using your shell's ^P (previous) and/or ^R (reverse search) features.)  

To get started, make yourself a little script that does something like this (one line):

rsync -e ssh -ravz --delete /sites/foo.com/webroot/ 
[EMAIL PROTECTED]:/sites/foo.com/webroot/

(It's aesthetically pleasing but not required that local and remote paths be the same; 
don't forget though that trailing slash on both directory arguments is REQUIRED or it 
means move one dir into the other.)

rsync will silently use ssh as the transport.  If you properly exchange keys for the 
local user and remoteuser, then ssh will not ask you for a password and so the rsync 
will happen instantaneously and non-interactively.  You can (and sometimes should) add 
the -n switch to see what rsync WOULD do -- i.e. to see which files/directories have 
changed since the last synch.

Just my 2-cents.

-c
-- 

------------------------------------------------------------------------
Chris Thorman         http://christhorman.com/      (413) 473-0853 e-fax
------------------------------------------------------------------------

Reply via email to