I need to create a secure remote connection to a couple of files (SFTP, WebDAV/HTTPS,…).

Users need to connect and edit those files by downloading->editing->uploading-replacing or, even better, by editing them in place (if WebDAV).

The server (Linux or as a last resort Mac OS X Server 10.6) should create revisions everytime files are updated/replaced: Is it possible?

Any suggestions would be greately appreciated.


You can use inotify cron(incron) and git(fast version control system)

Install icron:

sudo apt-get install incron

Install git:

sudo apt-get install git-core

Allow root use incron:

echo "root" > /etc/incron.allow

Create git repository:

mkdir /git
cd /git
git init

Create script to auto commit /usr/local/sbin/git-autocommit:



GIT_WORK_TREE=$NOTIFY_DIR /usr/bin/git add .
GIT_WORK_TREE=$NOTIFY_DIR /usr/bin/git commit -a -m "auto"

Add incron rules:

sudo incrontab -e
/srv IN_MODIFY,IN_CREATE,IN_MOVED_FROM,IN_MOVED_TO /usr/local/sbin/git-autocommit

I like git and Ubuntu)

  • Shouldn't the middle steps actually be "mkdir /git; cd /git; git init;" - otherwise you're not creating the git repo in the correct folder? – Coops Mar 1 '11 at 10:44
  • Yes, you are right – ooshro Mar 1 '11 at 10:47
  • +1 I hadn't come across incron before and it definitely will simplify some scripts I have hanging around the place! – Niall Donegan Mar 1 '11 at 11:39

You could use a version control system, like Subversion. However it will require users to use it, rather than straight file operations. Or you could use rsnapshot (or similar backup programme) to take hourly backups. You may loose some intermediate versions that way, but users won't have to use SVN.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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