Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Is there was a way to detect when a user uploads a file to a server and automatically check that file into source control? This is on a Solaris 10 server with WebStack.

I know that this is possible in reverse, however I'd really like to do it this way. The reason for this is that the company is just now moving to use SVN and we'd like to keep all the old developers (largely amateur) somewhat comfortable by not taking away the way they used to do things.

I've found this posting which is basically what I want, but for Linux. Is there a similar solution for Solaris?

share|improve this question

2 Answers 2

I'd say the cron / polling option mentioned on the posting you linked to is probably the easiest. Just have it run every minute, check for a lockfile for previously running svn commits, and if none are running and there are new files, commit them.

If you ftp files right into a checkout directory, then you can use "svn status" (which is very lightweight and returns quickly) to check for updated files. This should be reasonably fast regardless of the number of files updated. Plus, using the lockfile (as mentioned above) ensures that if it takes a long time to do a commit, it'll just get any files added in the interim after the current commit is done.

share|improve this answer
    
My concern with the cron method is how resource-heavy it could be. Our server has several hundred thousand files that would need to be monitored, yet there's usually only 20 or so being actively worked on. –  Nate Wagar Nov 6 '09 at 19:45
    
Good point. See the "svn status" stuff I just added. –  Graeme Nov 6 '09 at 19:51
    
It's quite possible that I'm just being thick, but I don't see how svn status could possibly be lighter (wouldn't it have to do basically the same work?) –  Nate Wagar Nov 6 '09 at 20:33
    
Sure, but it is very smart about that. It checks the timestamps on subdirectories, and doesn't recurse into ones that haven't been modified, etc. So unless all of your project files are in one big directory, it should be quite fast. Test it though! Run "time svn status" on the root of a current checkout, and see how long it takes for you. –  Graeme Nov 6 '09 at 21:22
    
Ah, gotcha. I will certainly try this out. –  Nate Wagar Nov 10 '09 at 16:17

Sorry for offtopic, but this way of SVN usage will give you nothing except headache in future and can make SVN implementation a very long process and even endless.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.