Keep Remote Directory Up-to-date

后端 未结 17 1716
一向
一向 2021-01-30 06:39

I absolutely love the Keep Remote Directory Up-to-date feature in Winscp. Unfortunately, I can\'t find anything as simple to use in OS X or Linux. I know the same thing can

17条回答
  •  执笔经年
    2021-01-30 07:25

    Building off of icco's suggestion of SVN, I'd actually suggest that if you are using subversion or similar for source control (and if you aren't, you should probably start) you can keep the production environment up to date by putting the command to update the repository into the post-commit hook.

    There are a lot of variables in how you'd want to do that, but what I've seen work is have the development or live site be a working copy and then have the post-commit use an ssh key with a forced command to log into the remote site and trigger an svn up on the working copy. Alternatively in the post-commit hook you could trigger an svn export on the remote machine, or a local (to the svn repository) svn export and then an rsync to the remote machine.

    I would be worried about things that detect changes and push them, and I'd even be worried about things that ran every minute, just because of race conditions. How do you know it's not going to transfer the file at the very same instant it's being written to? Stumble across that once or twice and you'll lose all of the time-saving advantage you had by constantly rsyncing or similar.

提交回复
热议问题