Created
July 26, 2012 15:50
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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