[Sussex] Reinventing the wheel

John Crowhurst info at johnscomputersupport.co.uk
Wed Feb 8 17:59:59 UTC 2012


Hello,

They have their own web server and individual accounts in cPanel. The 
users upload to their public_html directory.

I'm thinking of simply using Mercurial as I've worked out I can commit 
everything in their public_html directory. A short cronjob:

#!/bin/sh
cd /home/$1/public_html
hg init
find . * -mmin -5 |grep -v .hg|xargs hg add
hg commit -m "$1 committed"

The find will find all files in public_html that are less than 5 minutes 
old and then hg will add them to the system to be committed. The commit 
-m uses the message on the command line to commit the files to the 
repository.

I'm not sure what happens if they need to revert a file that they 
changed by mistake, whether they have to download the whole folder and 
revert using something like TortoiseHG or whether they can simply clone 
the repository and revert from that.

Best,

John

On 08/02/2012 16:43, John Patrick wrote:
> Dominic,
>
> Was actually asking the other John, but nice to know your solution as
> well. So I assume your has registered users and that links them to
> which git repo they upload into.
>
> John
>
> On 8 February 2012 16:41, Dominic Humphries<linux at oneandoneis2.org>  wrote:
>> External. Ish. The files can be edited by employees of client companies.
>> That's one of the reasons we use git - it makes it pretty near
>> impossible for them to delete or damage a file so badly we can't recover
>> it back to a previously-good state.
>>
>> Each client has their own directory, can't edit someone else's files.
>> All managed by one git repo tho.
>>
>> On Wed, 2012-02-08 at 16:30 +0000, John Patrick wrote:
>>> Is the website internal or external?
>>>
>>> Are users internal or external? i.e. anonymous public, registered
>>> public, registered trusted, employees?
>>>
>>> Is it a shared folder or registered user specific folder?
>>>
>>> Just thinking about what other solutions might be useful based upon
>>> those details...
>>>
>>> On 8 February 2012 16:04, Dominic Humphries<linux at oneandoneis2.org>  wrote:
>>>> We do something vaguely similar where I work. We use Git - every time a
>>>> file is uploaded via the website, it gets added/updated to the git repo.
>>>> Each git commit has a unique SHA and a trackable history, we can even
>>>> use it to show previous versions of files if they want to revert to
>>>> them.
>>>>
>>>> On Wed, 2012-02-08 at 15:36 +0000, John Crowhurst wrote:
>>>>> Hello,
>>>>>
>>>>> I wonder if you could help by pointing me in the right direction.
>>>>>
>>>>> I have a customer that wants to implement version control on his website
>>>>> so that when users upload files and folders they are copied elsewhere
>>>>> into another folder and compared to see if they have changed, and the
>>>>> changed files get tagged with a number for version control.
>>>>>
>>>>> I'm sure there is a much better way to do this, such as checking in the
>>>>> files to CVS or similar.
>>>>>
>>>>> Can anyone advise?
>>>>>
>>>>> Best,
>>>>>
>>>>> John
>>>>>
>>>>> --
>>>>> Sussex mailing list
>>>>> Sussex at mailman.lug.org.uk
>>>>> E-mail Address: sussex at mailman.lug.org.uk
>>>>> Sussex LUG Website: http://www.sussex.lug.org.uk/
>>>>> https://mailman.lug.org.uk/mailman/listinfo/sussex
>>>>
>>>>
>>>> --
>>>> Sussex mailing list
>>>> Sussex at mailman.lug.org.uk
>>>> E-mail Address: sussex at mailman.lug.org.uk
>>>> Sussex LUG Website: http://www.sussex.lug.org.uk/
>>>> https://mailman.lug.org.uk/mailman/listinfo/sussex
>>> --
>>> Sussex mailing list
>>> Sussex at mailman.lug.org.uk
>>> E-mail Address: sussex at mailman.lug.org.uk
>>> Sussex LUG Website: http://www.sussex.lug.org.uk/
>>> https://mailman.lug.org.uk/mailman/listinfo/sussex
>>
>>
>> --
>> Sussex mailing list
>> Sussex at mailman.lug.org.uk
>> E-mail Address: sussex at mailman.lug.org.uk
>> Sussex LUG Website: http://www.sussex.lug.org.uk/
>> https://mailman.lug.org.uk/mailman/listinfo/sussex
> --
> Sussex mailing list
> Sussex at mailman.lug.org.uk
> E-mail Address: sussex at mailman.lug.org.uk
> Sussex LUG Website: http://www.sussex.lug.org.uk/
> https://mailman.lug.org.uk/mailman/listinfo/sussex




More information about the Sussex mailing list