Auto backup (2022-06-15T21:00:48.856Z)
This commit is contained in:
274
flows/33.json
274
flows/33.json
@@ -1,15 +1,15 @@
|
||||
{
|
||||
"id": 33,
|
||||
"name": "Git backup of ESPHOME",
|
||||
"active": false,
|
||||
"active": true,
|
||||
"nodes": [
|
||||
{
|
||||
"parameters": {},
|
||||
"name": "Start",
|
||||
"type": "n8n-nodes-base.start",
|
||||
"position": [
|
||||
200,
|
||||
260
|
||||
180,
|
||||
620
|
||||
],
|
||||
"typeVersion": 1
|
||||
},
|
||||
@@ -18,7 +18,7 @@
|
||||
"triggerTimes": {
|
||||
"item": [
|
||||
{
|
||||
"hour": 0
|
||||
"hour": 23
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -27,176 +27,59 @@
|
||||
"type": "n8n-nodes-base.cron",
|
||||
"position": [
|
||||
200,
|
||||
400
|
||||
260
|
||||
],
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"command": "npx n8n export:workflow --backup --output /home/node/.n8n/backup/flows/"
|
||||
"command": "=git commit -m \"Auto backup ({{ new Date().toISOString() }})\"",
|
||||
"cwd": "/opt/esphome/config"
|
||||
},
|
||||
"name": "Export Workflows",
|
||||
"type": "n8n-nodes-base.executeCommand",
|
||||
"position": [
|
||||
460,
|
||||
620
|
||||
],
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"command": "npx n8n export:credentials --backup --output /home/node/.n8n/backup/credentials/"
|
||||
},
|
||||
"name": "Export Credentials",
|
||||
"type": "n8n-nodes-base.executeCommand",
|
||||
"position": [
|
||||
640,
|
||||
620
|
||||
],
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"command": "cd /home/node/.n8n/backup/ && git add ."
|
||||
},
|
||||
"name": "git add",
|
||||
"type": "n8n-nodes-base.executeCommand",
|
||||
"position": [
|
||||
800,
|
||||
360
|
||||
],
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"command": "=cd /home/node/.n8n/backup/ && git commit -m \"Auto backup ({{ new Date().toISOString() }})\""
|
||||
},
|
||||
"name": "git commit",
|
||||
"type": "n8n-nodes-base.executeCommand",
|
||||
"position": [
|
||||
1180,
|
||||
320
|
||||
],
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"command": "cd /home/node/.n8n/backup/ && git push https://nia:4159b2141ce710381857585e10f643c40ea613e3@lab.cynic.club/nia/n8n.git --all \n"
|
||||
},
|
||||
"name": "git push",
|
||||
"type": "n8n-nodes-base.executeCommand",
|
||||
"position": [
|
||||
1360,
|
||||
380
|
||||
],
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"command": "git config --global user.email \"ihor.nahornyy@gmail.com\" &&\n git config --global user.name \"nia\""
|
||||
},
|
||||
"name": "add username",
|
||||
"type": "n8n-nodes-base.executeCommand",
|
||||
"name": "git commit1",
|
||||
"type": "n8n-nodes-base.ssh",
|
||||
"typeVersion": 1,
|
||||
"position": [
|
||||
1000,
|
||||
360
|
||||
]
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"operation": "addConfig",
|
||||
"repositoryPath": "/home/node/.n8n/backup",
|
||||
"key": "user.email",
|
||||
"value": "ihor.nahornyy@gmail.com",
|
||||
"options": {}
|
||||
},
|
||||
"name": "Git",
|
||||
"type": "n8n-nodes-base.git",
|
||||
"typeVersion": 1,
|
||||
"position": [
|
||||
1000,
|
||||
620
|
||||
]
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"operation": "addConfig",
|
||||
"repositoryPath": "/home/node/.n8n/backup",
|
||||
"key": "user.name",
|
||||
"value": "nia",
|
||||
"options": {}
|
||||
},
|
||||
"name": "Git1",
|
||||
"type": "n8n-nodes-base.git",
|
||||
"typeVersion": 1,
|
||||
"position": [
|
||||
1160,
|
||||
620
|
||||
]
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"authentication": "gitPassword",
|
||||
"operation": "push",
|
||||
"repositoryPath": "/home/node/.n8n/backup",
|
||||
"options": {
|
||||
"targetRepository": "https://lab.cynic.club/nia/n8n.git"
|
||||
}
|
||||
},
|
||||
"name": "Git2",
|
||||
"type": "n8n-nodes-base.git",
|
||||
"typeVersion": 1,
|
||||
"position": [
|
||||
1480,
|
||||
620
|
||||
720,
|
||||
260
|
||||
],
|
||||
"credentials": {
|
||||
"gitPassword": {
|
||||
"id": "30",
|
||||
"name": "Git account"
|
||||
"sshPassword": {
|
||||
"id": "33",
|
||||
"name": "automation"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"operation": "add",
|
||||
"repositoryPath": "/home/node/.n8n/backup",
|
||||
"pathsToAdd": "."
|
||||
"command": "git push https://nia:4159b2141ce710381857585e10f643c40ea613e3@lab.cynic.club/nia/esphome.git --all ",
|
||||
"cwd": "/opt/esphome/config"
|
||||
},
|
||||
"name": "Git3",
|
||||
"type": "n8n-nodes-base.git",
|
||||
"typeVersion": 1,
|
||||
"position": [
|
||||
820,
|
||||
620
|
||||
]
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"operation": "commit",
|
||||
"repositoryPath": "/home/node/.n8n/backup",
|
||||
"message": "=Auto backup ({{ new Date().toISOString() }})",
|
||||
"options": {}
|
||||
},
|
||||
"name": "Git4",
|
||||
"type": "n8n-nodes-base.git",
|
||||
"typeVersion": 1,
|
||||
"position": [
|
||||
1320,
|
||||
620
|
||||
]
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"command": "cd /opt/homeassistant_rokoss && ls"
|
||||
},
|
||||
"name": "SSH",
|
||||
"name": "git push1",
|
||||
"type": "n8n-nodes-base.ssh",
|
||||
"typeVersion": 1,
|
||||
"position": [
|
||||
460,
|
||||
280
|
||||
940,
|
||||
260
|
||||
],
|
||||
"credentials": {
|
||||
"sshPassword": {
|
||||
"id": "33",
|
||||
"name": "automation"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"command": "git add .",
|
||||
"cwd": "/opt/esphome/config"
|
||||
},
|
||||
"name": "git add",
|
||||
"type": "n8n-nodes-base.ssh",
|
||||
"typeVersion": 1,
|
||||
"position": [
|
||||
480,
|
||||
260
|
||||
],
|
||||
"credentials": {
|
||||
"sshPassword": {
|
||||
@@ -211,40 +94,18 @@
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Export Workflows",
|
||||
"node": "git add",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Start": {
|
||||
"git commit1": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "SSH",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Export Workflows": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Export Credentials",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Export Credentials": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Git3",
|
||||
"node": "git push1",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
@@ -255,65 +116,16 @@
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "add username",
|
||||
"node": "git commit1",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Git": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Git1",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Git1": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Git4",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Git3": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Git",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Git4": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Git2",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"git push": {
|
||||
"main": [
|
||||
[]
|
||||
]
|
||||
}
|
||||
},
|
||||
"createdAt": "2022-06-15T06:06:51.257Z",
|
||||
"updatedAt": "2022-06-15T06:43:37.274Z",
|
||||
"updatedAt": "2022-06-15T07:55:13.751Z",
|
||||
"settings": {
|
||||
"errorWorkflow": "25"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user