-
Notifications
You must be signed in to change notification settings - Fork 0
Blueprints Directories
The Directories Blueprint in Rinse, Wash, Repeat (RWR) allows you to manage directories on your system. You can create, delete, copy, move, and set permissions and ownership for directories.
The Directories Blueprint has the following structure:
directories:
- name: string
names: []string
action: string
source: string
target: string
owner: int
group: int
mode: int
create: bool
elevated: bool
The following settings are available for the Directories Blueprint:
Setting | Type | Description |
---|---|---|
|
string |
The name of the directory |
|
[]string |
An array of directory names to perform the action on |
|
string |
The action to perform on the directory (create, delete, copy, move, chmod, chown, chgrp, symlink) |
|
string |
The source directory path (for copy, move, and symlink actions) |
|
string |
The target directory path |
|
int |
The user ID of the directory owner (for chown action) |
|
int |
The group ID of the directory group (for chgrp action) |
|
int |
The permissions of the directory in octal notation (for chmod action) |
|
bool |
Whether to create the parent directories if they don’t exist (default: false) |
|
bool |
Whether to perform the action with elevated privileges (default: false) |
Here are some examples of using the Directories Blueprint in different formats:
directories:
- name: mydir
action: create
target: /path/to/mydir
mode: 0755
create: true
elevated: true
- names:
- dir1
- dir2
action: copy
source: /path/to/source
target: /path/to/destination
owner: 1000
group: 1000
{
"directories": [
{
"name": "mydir",
"action": "create",
"target": "/path/to/mydir",
"mode": 493,
"create": true,
"elevated": true
},
{
"names": [
"dir1",
"dir2"
],
"action": "copy",
"source": "/path/to/source",
"target": "/path/to/destination",
"owner": 1000,
"group": 1000
}
]
}
[[directories]]
name = "mydir"
action = "create"
target = "/path/to/mydir"
mode = 493
create = true
elevated = true
[[directories]]
names = ["dir1", "dir2"]
action = "copy"
source = "/path/to/source"
target = "/path/to/destination"
owner = 1000
group = 1000
These examples demonstrate how to create a directory with specific permissions, copy multiple directories while setting owner and group, and perform actions with elevated privileges.
For more information on the available actions and their specific requirements, please refer to the Blueprints Overview page.