O'Reilly logo

CFEngine 3 Beginner's Guide by Rajneesh

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action - taking file backups

  1. Let's write a configuration file for backing up important configuration files under /etc/sysconfig on a remote server.
  2. We will use the copy_from promise for this. You may use the following lines in your configuration file user_data_bkup.cf:
    {bundle agent backup
    {
    files:
    "/mnt/backup"
    copy_from => remote_cp( "/etc/sysconfig", "172.16.3.113"),
    depth_search => recurse("inf"),
    }
    body copy_from remote_cp(user_data,user_server)
    {
    source => "$(user_data)";
    servers => "$(user_server)";
    trustkey => "true";
    verify => "true";
    }
    
  3. Now as a best practice, the file user_data_bkup.cf should be committed to a version control system which may be a SVN or CVS from which the policy distribution server may do a "headless" checkout ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required