Scan subversion files and data for virus

Can we scan the data in the subversion repository ?
This was a big doubt I had in my mind for quite a long time.

helps us to verify our data. There are ways to verify the data is virus-free before commiting it to the subversion repo.
This can be done by making use of the pre-commit script.

cd PATH_TO_REPOS/hooks
cp pre-commit.tmpl pre-commit

Now we can edit the pre-commit script as needed, either to verify our data or any other purpose.

chmod u+x pre-commit # It needs to be executable

The pre-commit hook gives you an opportunity to catch the transaction just before it becomes a revision.

Here is a sample shell script where I’m making the transaction to sleep for some time.




$SVNLOOK changed -t “$TXN” “$REPOS” | grep xxx #checking for the box xxx and make it sleep for 30
if [ $? = 0 ]
sleep 30

$SVNLOOK changed -t “$TXN” “$REPOS” | grep yyy #checking for the box yyy and make it sleep for 60
if [ $? = 0 ]
sleep 60

exit 0

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s