I'm responsible for maintaining a series of scripts, the purpose of which is to pull data from an API once a day and update a database. When I took over this role, the scripts were stored in SVN, and once a day a cronjob would run as root, update the svn, and then run the scripts from the svn directory.

Now, I'd like to rework the logic of this set up, switch from root to a service account, etc. I'd like to keep the scripts under version control, but it seems odd to run out of the SVN directory.

What's the best way to arrange this?

1 Answer 1


I think you've already identified the two things that should be changed:

  1. Stop running the scripts as root. There shouldn't be any reason to have to do that, and it creates an easy privilege escalation vulnerability unless only root can write to the scripts. From your description, it sounds as though the only permissions the scripts should need will be to update the SVN tree, and write to the database. So create a dedicated user account for the purpose, and give it just enough permissions to do those two things. Then run the scripts from a cron job owned by that user.

  2. If I understand right, it sounds as though the programs and the data they're pulling are being held in the same SVN repository. I guess that works, but mixing programs and data is bad practice, especially since the programs will be updated only occasionally, while the data are being updated daily. I would separate them into separate SVN repositories.

  • So would you say running the code from the svn directory rather than copying it elsewhere isn't problematic? Jul 28, 2014 at 16:28
  • No, I don't think that's a problem. Jul 28, 2014 at 16:29

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.