Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have virtual machine with Linux (Ubuntu server) which is used as prototype for other machines. Sometimes I make changes in prototype system and want to import this changes at some other machine.

I know about Puppet, cfengine and FAI but want something easy for example rsync script which will work through ssh when it needed.

Main goal is /etc/ directory. But I don't want to syncronize some private files for example /etc/passwd /etc/shadow and so on. I don't know all of it.

Are there tips for my task ? May be someone have such rsync script.

share|improve this question

migrated from Nov 1 '12 at 14:54

This question came from our site for system and network administrators.

A simple solution might be to setup git.

  • Setup a git repository in your /etc directory.
  • Setup an ignore file to exclude things you don't want to migrate to the remote system.
  • Add everything not ignored into your repository.
  • On the production pull from the dev repository as needed.
share|improve this answer
Really good approach with versioning. Remains only determine ignorance files. – entend Oct 31 '12 at 16:51
Only you can determine that. I might start with a simple grep pat * -R for the hostname, and any other facts that are local to the system. You could also setup a third testing machine to try on the process initially. – Zoredache Oct 31 '12 at 16:55
looks like etckeeper could realy help you here. – l1zard Nov 1 '12 at 22:39

You already have the answer. rsync can do what you want, it runs over ssh when you want it to, and it can easily ignore files you don't want it to sync:

rsync -avP source:/etc/ /etc/ --exclude-from list-of-files-to-exclude

And just add a list of files to exclude to the list-of-files-to-exclude flie. For example:

$ cat list-of-files-to-exclude

Of course I would still strongly recommend version control, and something more sophisticated like puppet. And make sure you take care of file ownership and permissions.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .