Feature request for SSH FTP

Peter Stuge
Sun, 09 Aug 2009 08:46:51 -0000

dawg wrote:
> This is a major problem if the file you are overwriting, for
> example, is a server script which is accessed hundreds or thousands
> of times per minute.

I would suggest that you investigate a more robust routine than using
SFTP for updating your production services.

You want to find an atomic system feature which allows you to switch
between two files, or two sets of files.

I suggest that you look into the application server (httpd if this is
a web server) for this. With Apache, one way would be:

Create new site folder
Upload new contents
Change virtualhost configuration to point to new site folder
apachectl graceful # will not abort any current connections

If you do not have permission to do this on your current server,
either look for another server, look at other alternatives (rsync
can do what you request, and can run over ssh) or simply use the
suggested workaround of manually renaming the file two times. Maybe
you can even script some SFTP clients to do it automatically.


//Peter