|
| 1 | +<script type="text/javascript"> |
| 2 | + RED.nodes.registerType('rsync', { |
| 3 | + category: 'advanced', |
| 4 | + color: '#a6bbcf', |
| 5 | + defaults: { |
| 6 | + name: { value: ""}, |
| 7 | + source: { value: "" }, |
| 8 | + destination: { value: "" }, |
| 9 | + verbose: { value: "" }, |
| 10 | + recursive: { value: "" }, |
| 11 | + }, |
| 12 | + inputs: 1, |
| 13 | + outputs: 2, |
| 14 | + icon: "file.png", |
| 15 | + label: function() { |
| 16 | + return this.name || "rsync"; |
| 17 | + } |
| 18 | + }); |
| 19 | +</script> |
| 20 | + |
| 21 | +<script type="text/x-red" data-template-name="rsync"> |
| 22 | + <div class="form-row"> |
| 23 | + <label for="node-input-name"><i class="icon-tag"></i> Name</label> |
| 24 | + <input type="text" id="node-input-name" placeholder="Name"> |
| 25 | + </div> |
| 26 | + <div class="form-row"> |
| 27 | + <label for="node-input-source"><i class="fa fa-file-text-o"></i> Source</label> |
| 28 | + <input type="text" id="node-input-source" placeholder="Source"> |
| 29 | + </div> |
| 30 | + <div class="form-row"> |
| 31 | + <label for="node-input-destination"><i class="fa fa-file-text-o"></i> Destination</label> |
| 32 | + <input type="text" id="node-input-destination" placeholder="Destination"> |
| 33 | + </div> |
| 34 | + <div class="form-row"> |
| 35 | + <label for="node-input-verbose"><i class="fa fa-bug"></i> Verbose</label> |
| 36 | + <input type="checkbox" id="node-input-verbose" style="display: inline-block; width: auto; vertical-align: top;"> |
| 37 | + </div> |
| 38 | + <div class="form-row"> |
| 39 | + <label for="node-input-recursive"><i class="fa fa-bug"></i> Recursive</label> |
| 40 | + <input type="checkbox" id="node-input-recursive" style="display: inline-block; width: auto; vertical-align: top;"> |
| 41 | + </div> |
| 42 | +</script> |
| 43 | + |
| 44 | +<script type="text/x-red" data-help-name="rsync"> |
| 45 | +<p>Uses rsyncwrapper to call rsync.</p> |
| 46 | +<p>The node can be configured with the source and destination, as well as the options below.</p> |
| 47 | +<p>When configured through the dialog, the source can only be a single folder or filename. However, when configured |
| 48 | +through msg, the source can also be an array of folders or filenames.</p> |
| 49 | + |
| 50 | +<h3>Inputs</h3> |
| 51 | +<p>The following can be overridden by including them in the input msg</p> |
| 52 | +<dl class="message-properties"> |
| 53 | + <dt>source |
| 54 | + <span class="property-type">string or array</span> |
| 55 | + </dt> |
| 56 | + <dd>The folder or filename to copy from. Can also be an array of folders and filenames.</dd> |
| 57 | + <dt>destination |
| 58 | + <span class="property-type">string</span> |
| 59 | + </dt> |
| 60 | + <dd>The folder or filename to copy to.</dd> |
| 61 | + <dt>verbose |
| 62 | + <span class="property-type">boolean</span> |
| 63 | + </dt> |
| 64 | + <dd>Include verbose flag on rsync command.</dd> |
| 65 | + <dt>recursive |
| 66 | + <span class="property-type">boolean</span> |
| 67 | + </dt> |
| 68 | + <dd>Recursively copy child folders.</dd> |
| 69 | +</dl> |
| 70 | +<h3>Outputs</h3> |
| 71 | +<dl class="message-properties"> |
| 72 | +The resulting message will be sent to the first output if successfully, or the second output upon failure. The message will contain |
| 73 | +all of the input properties, as well as the following as appropriate: |
| 74 | + |
| 75 | + <dt>error |
| 76 | + <span class="property-type">string</span> |
| 77 | + </dt> |
| 78 | + <dt>stdout |
| 79 | + <span class="property-type">string</span> |
| 80 | + </dt> |
| 81 | + <dt>stderr |
| 82 | + <span class="property-type">string</span> |
| 83 | + </dt> |
| 84 | + <dt>cmd |
| 85 | + <span class="property-type">string</span> |
| 86 | + <dd>The command line as sent to rsync.</dd> |
| 87 | + </dt> |
| 88 | +</script> |
0 commit comments