From 2cd006de79c74caa5457ec0612f3a8ddc53ac792 Mon Sep 17 00:00:00 2001 From: Dominique Roux Date: Sun, 29 Oct 2017 17:23:35 +0100 Subject: [PATCH] F/ccollect create destination (#548) --- cdist/conf/type/__ccollect_source/man.rst | 9 +++++++++ cdist/conf/type/__ccollect_source/manifest | 4 ++++ cdist/conf/type/__ccollect_source/parameter/boolean | 1 + 3 files changed, 14 insertions(+) diff --git a/cdist/conf/type/__ccollect_source/man.rst b/cdist/conf/type/__ccollect_source/man.rst index 617571bb..b0c23482 100644 --- a/cdist/conf/type/__ccollect_source/man.rst +++ b/cdist/conf/type/__ccollect_source/man.rst @@ -38,6 +38,8 @@ BOOLEAN PARAMETERS verbose Whether to report backup verbosely +create-destination + Create the directory specified in the destination parameter on the remote host EXAMPLES -------- @@ -50,6 +52,13 @@ EXAMPLES --exclude '/proc/*' --exclude '/sys/*' \ --verbose + __ccollect_source doc.ungleich.ch \ + --source doc.ungleich.ch:/ \ + --destination /backup/doc.ungleich.ch \ + --exclude '/proc/*' --exclude '/sys/*' \ + --verbose \ + --create-destination + SEE ALSO -------- diff --git a/cdist/conf/type/__ccollect_source/manifest b/cdist/conf/type/__ccollect_source/manifest index 22326d7b..238c7e76 100755 --- a/cdist/conf/type/__ccollect_source/manifest +++ b/cdist/conf/type/__ccollect_source/manifest @@ -53,3 +53,7 @@ if [ -f "$__object/parameter/exclude" ]; then __file "$exclude_file" --source - --state "$state" \ < "$__object/parameter/exclude" fi + +if [ -f "$__object/parameter/create-destination" ]; then + __directory "${destination}" --parents --state ${state} +fi diff --git a/cdist/conf/type/__ccollect_source/parameter/boolean b/cdist/conf/type/__ccollect_source/parameter/boolean index c00ee94a..434c644f 100644 --- a/cdist/conf/type/__ccollect_source/parameter/boolean +++ b/cdist/conf/type/__ccollect_source/parameter/boolean @@ -1 +1,2 @@ verbose +create-destination