Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 serverfault.com Nov 1 '12 at 14:54

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

add comment

2 Answers

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. joeyh.name/code/etckeeper –  l1zard Nov 1 '12 at 22:39
add comment

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
/passwd
/shadow

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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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