Reputation: 19831
I have a web dev. client using a shared host that doesn't allow shell access, and thus no access to SVN, Git, etc. I've tried to convince him to move to one of the many cheap options that allow it, but he won't do it. If I use version control on my staging server, are there any tools that will allow me to replicate the changes to production via ftp? Locally I have both mac & windows, the staging server is linux, so something that works on any of those platforms....
Upvotes: 2
Views: 4041
Reputation: 6337
Rsync will do this over an FTP connection. You probably already have it installed if you’re on a Unix-like system.
Upvotes: 0
Reputation: 2343
This question (and answer) really helped me just now as I implemented version control via gitolite
on a separate server and lftp.
Here’s what I did:
gitolite
on my ubuntu staging serverfoo.git
) on staging serverfoo.git
into working directory on staging serverfoo.git
into working directory on local development machinefoo.git
repo on staging serverfoo.git
lftp
-ed into shared host (like you mention above)mirror -R --only-newer --delete --parallel=10 /source/directory/ /target/directory
Notes on the mirror
command options:
-R
- this pushes the source/directory
to the target/directory
. (mirror
pulls in from target to source without this, think r
everse)—only-newer
- without this option, even if you only changed one file, the mirror
command will send all the files in the source directory over to the target directory. with this option only the changed (newer) files are transferred over the wire.—delete
- deletes files that are no longer in the source directory but still in the target directory. one of my pushes involved deleting expired assets. without this option, the same files would have stayed put on my shared host after executing the mirror
command.—parallel=10
- transfers 10 files at once (instead of 1 by default). this made the process much fasterWhile this is what worked for me, I’m sure there are ways to improve on this. I was grateful for this question and thought i’d share my experience.
Upvotes: 0
Reputation: 685
Good thing for keeping SVN repo and FTP copy in sync is svn2web. May I suggest creating separate branch for production copy and do merges to that branch for uploading to production server.
Upvotes: 1
Reputation: 15493
Using your Linux staging server you could keep a separate checked out copy that you use specifically for that host and then use a utility to mirror that directory with the host server.
LFTP is useful for this kind of thing. Its available for most Linux distributions and includes a 'mirror' function:
Mirror specified source directory to local target directory. If target directory ends with a slash, the source base name is appended to target directory name. Source and/or target can be URLs pointing to directories.
Upvotes: 3
Reputation: 614
Some kind of ftp mirror software is what you need. Not tested it but a quick search gave me this Java application. You could run that over your up-to-date checked out repository.
Upvotes: 1
Reputation:
Short of finding / implementing some FUSE based CoW file system that supports immutable versions .. I'd just find another (more developer friendly) host. As far as I know, no FTP server supports this natively, nor can I think of any elegant means of putting it in place with script hackery.
I could be wrong.
Upvotes: 0
Reputation: 43619
You probably need to write a batch file that is able to
Upvotes: 0