Empty All Recycles
Clear all workspaces recycle bin folders.
Usecase Overview
This Flow finds all "recycle bin" inside all workspaces, and empty their contents on a regular basis.
How It Works
"Recycle bins" are created as a sub-folder named "recycle_bin" of any folder tagged with the special recycle_root
ACL.
That way, when deleting any file or folder, Cells seeks for the first "recycle_root" in the parents and move the file/folder inside the corresponding Recycle Bin.
To find all recycle, this flow :
* Looks up for this recycle_root
ACL,
* Loads the corresponding node (ACL refer to nodes via their UUID
and we need to reload them to get their Path
),
* Compute the recycle path by appending recycle_bin to the path
* Finally calls the "Delete" action.
Default setup makes it run every day at 3AM, but it can also be ran manually.
Parameters
No parameters defined
Trigger Type
Scheduled
JSON Representation
{
"Label": "Empty All Recycles",
"Owner": "pydio.system.user",
"Metadata": {
"Description": "Clear all workspaces recycle bin folders",
"Icon": "mdi mdi-delete-forever",
"TplCategory": "maintenance",
"Usage": "### Usecase Overview\n\nThis Flow finds all \"recycle bin\" inside all workspaces, and empty their contents on a regular basis.\n\n### How It Works\n\n\"Recycle bins\" are created as a sub-folder named \"recycle_bin\" of any folder tagged with the special `recycle_root` ACL. \nThat way, when deleting any file or folder, Cells seeks for the first \"recycle_root\" in the parents and move the file/folder inside the corresponding Recycle Bin.\n\nTo find all recycle, this flow : \n * Looks up for this `recycle_root` ACL, \n * Loads the corresponding node (ACL refer to nodes via their `UUID` and we need to reload them to get their `Path`), \n * Compute the recycle path by appending recycle_bin to the path\n * Finally calls the \"Delete\" action.\n\nDefault setup makes it run every day at 3AM, but it can also be ran manually."
},
"Schedule": {
"Iso8601Schedule": "R/2020-03-04T02:00:59.471Z/PT24H"
},
"Actions": [
{
"ID": "actions.scheduler.log-input",
"Label": "Recycle Root ACLs",
"IdmSelector": {
"Type": 3,
"All": true,
"Query": {
"SubQueries": [
{
"type_url": "type.googleapis.com/idm.ACLSingleQuery",
"value": "Cg4KDHJlY3ljbGVfcm9vdA=="
}
]
},
"Label": "Find \"recycle_root\" ACLs"
},
"Parameters": {
"fieldname/@value": "FileName",
"internalLogger": "false",
"taskLogger": "true"
},
"ChainedActions": [
{
"ID": "actions.scheduler.log-input",
"Label": "Recycle Root Folder",
"NodesSelector": {
"All": true,
"Query": {
"SubQueries": [
{
"type_url": "type.googleapis.com/tree.Query",
"value": "eg97ey5BY2wuTm9kZUlEfX0="
}
],
"Operation": 1
},
"Collect": true,
"Label": "Find folder for ACL"
},
"Parameters": {
"fieldname": "{\"@value\":\"UUIDs\"}",
"internalLogger": "false",
"message": "Acl Node: {{.Acl.NodeID}}",
"taskLogger": "true"
},
"ChainedActions": [
{
"ID": "actions.scheduler.log-input",
"Label": "Recycle Bin Folder",
"NodesSelector": {
"Query": {
"SubQueries": [
{
"type_url": "type.googleapis.com/tree.Query",
"value": "OgtyZWN5Y2xlX2Jpbmoae3suTm9kZS5QYXRofX0vcmVjeWNsZV9iaW4="
}
],
"Operation": 1
},
"Label": "Find Recycle Bin"
},
"Parameters": {
"fieldname": "{\"@value\":\"Paths\"}",
"internalLogger": "false",
"message": "Will delete children of {{.Node.Path}}",
"taskLogger": "true"
},
"ChainedActions": [
{
"ID": "actions.tree.delete",
"Label": "Clear content",
"Parameters": {
"childrenOnly": "true",
"fieldname/@value": "FileName"
}
}
]
}
]
}
]
}
]
}
Back to top