github.com/facebookincubator/ttpforge@v1.0.13-0.20240405153150-5ae801628835/docs/foundations/actions/copy_path.md (about) 1 # TTPForge Actions: `copy_path` 2 3 The `copy_path` action can be used to copy files on disk without the need to 4 loudly invoke a shell and use `cat`, `echo`, or `cp`. Check out the TTP below to 5 see how it works: 6 7 https://github.com/facebookincubator/TTPForge/blob/ce5561457f6d9a6f61cf3b6ed0b3ea69a32550eb/example-ttps/actions/copy-path/basic.yaml#L1-L18 8 9 You can experiment with the above TTP by installing the `examples` TTP 10 repository (skip this if `ttpforge list repos` shows that the `examples` repo is 11 already installed): 12 13 ```bash 14 ttpforge install repo https://github.com/facebookincubator/TTPForge --name examples 15 ``` 16 17 and then running the below command: 18 19 ```bash 20 ttpforge run examples//actions/copy-path/basic.yaml 21 ``` 22 23 ## Fields 24 25 You can specify the following YAML fields for the `copy_path:` action: 26 27 - `copy_path:` (type: `string`) the path to the file or directory you want to 28 copy. 29 - `to:` (type: `string`) the path to the file or directory you want to write the 30 copy to file. 31 - `recursive:` (type: `bool`) whether or not the copy action should be recursive 32 (copy all files in directory) 33 - `overwrite:` (type: `bool`) whether the file(s) should be overwritten if they 34 already exist in the destination. 35 - `mode:` the octal permission mode (`chmod` style) for the new file. 36 - `cleanup:` you can set this to `default` in order to automatically cleanup the 37 created file, or define a custom 38 [cleanup action](https://github.com/facebookincubator/TTPForge/blob/main/docs/foundations/cleanup.md#cleanup-basics).