On Wed, Sep 17, 2008 at 9:26 PM, Jon Schewe <jpschewe at mtu.net> wrote: > Sunny wrote: >> On Wed, Sep 17, 2008 at 1:55 PM, Jon Schewe <jpschewe at mtu.net> wrote: >> >>> I've got a number of servers that have similar configs. The configs that >>> I make manually I'm keeping in subversion so that we can track changes. >>> Right now I'm pushing them out to the servers using rsync. The problem >>> that I've run into is that if someone is debugging a problem on the >>> server they make changes to the server and if they forget to push the >>> changes back into subversion the next time the sync script pushes the >>> files out the changes get overwritten. I would rather be notified on the >>> next sync that something on the server has been changed since the last sync. >>> >>> Has anyone done something like this and have a good solution? I've >>> thought about unison, and that would probably work, the downside is that >>> it always needs to be run from the same machine otherwise it doesn't >>> know the state of the last sync and there are two admins that both may >>> sync from their workstations. >>> >>> Thanks. >>> >>> >> >> Use post-commit hooks in your svn repository to push the changes to >> the servers. That way, changes will propagate only if they are >> committed in the repo. >> >> >> > That's a good way to kick the script off, but doesn't handle the case > where someone modifies the server and not the repository, which is where > the problem is right now. > I'm not sure I have the details right but you have a checkout of the svn repository someplace, then using rsync to push appropriate files from the master checkout into place on each server. Before you start the the process you have a checkout someplace which contains the last files you pushed to the servers. The files in svn may or may not but different from these. So run a diff between the files in your master checkout and the files on the servers. If different, then the file could be current with what is in svn, or it could have been modified without commit. keep those different files in a list someplace. Now update your master checkout so it is current files you want to push and run the diff again for the files in your list. If still different than its probably a modified without commit file - send your notice. there's a chance this could not work if the file was updated several times since the last push and a the server contains version that was committed sometime between the last push and the current version. - or - you could pull the files directly from svn to the servers and skip rsync. -- Tom Penney 612-920-3562