Skip to content

Instantly share code, notes, and snippets.

@jbd
Created July 26, 2012 15:50
Show Gist options
  • Save jbd/3182848 to your computer and use it in GitHub Desktop.
Save jbd/3182848 to your computer and use it in GitHub Desktop.
Trying to find the best way to append a file at the end of the other
body common control
{
bundlesequence => { "biginsert" };
inputs => { "cfengine_stdlib.cf" };
}
body agent control
{
editfilesize => "1M";
}
bundle agent biginsert
{
files:
# I remove the file for testing purpose
# to prevent every growing file
"/tmp/bigfile"
delete => tidy,
classes => if_ok("file_deleted");
file_deleted::
"/tmp/bigfile"
edit_line => big_edit("/tmp/bigdata"),
create => "true";
}
bundle edit_line big_edit(content_from_file)
{
insert_lines:
"$(content_from_file)"
insert_type => "file";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment