4

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.

Coops
  • 5,967
  • 1
  • 31
  • 52
Gabriele
  • 331
  • 1
  • 4
  • 13

2 Answers2

8

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:

#!/bin/bash

REP_DIR="/git"
NOTIFY_DIR="/srv"

cd $REP_DIR
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)

ooshro
  • 10,874
  • 1
  • 31
  • 31
0

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.

Amandasaurus
  • 30,211
  • 62
  • 184
  • 246