Auto backup (2022-06-15T07:08:13.074Z)

This commit is contained in:
nia
2022-06-15 07:08:13 +00:00
parent a17d86119c
commit 7652dccaf4
8 changed files with 382 additions and 39 deletions

View File

@@ -161,11 +161,11 @@
}
},
"createdAt": "2022-04-29T05:12:17.339Z",
"updatedAt": "2022-06-14T13:57:56.146Z",
"updatedAt": "2022-06-15T06:46:10.977Z",
"settings": {},
"staticData": {
"node:IMAP Email": {
"lastMessageUid": 6309
"lastMessageUid": 6311
}
},
"tags": []

View File

@@ -78,6 +78,34 @@
460
]
},
{
"parameters": {
"values": {
"string": [
{
"name": "deadline_date",
"value": "={{$json[\"dueDateTime\"][\"dateTime\"]}}"
},
{
"name": "dead_date",
"value": "={{DateTime.fromISO($json[\"dueDateTime\"][\"dateTime\"]).plus({days: 7}).toString()}}"
},
{
"name": "days_to_dead",
"value": "={{$today.diff(DateTime.fromISO($json[\"dueDateTime\"][\"dateTime\"]).plus({days: 7}), 'days').toObject().days.toString().substring(1, 2)}}"
}
]
},
"options": {}
},
"name": "Set",
"type": "n8n-nodes-base.set",
"typeVersion": 1,
"position": [
1140,
460
]
},
{
"parameters": {
"operation": "sendTemplate",
@@ -122,34 +150,6 @@
"name": "Mailjet Email account"
}
}
},
{
"parameters": {
"values": {
"string": [
{
"name": "deadline_date",
"value": "={{$json[\"dueDateTime\"][\"dateTime\"]}}"
},
{
"name": "dead_date",
"value": "={{DateTime.fromISO($json[\"dueDateTime\"][\"dateTime\"]).plus({days: 7}).toString()}}"
},
{
"name": "days_to_dead",
"value": "={{$today.diff(DateTime.fromISO($json[\"dueDateTime\"][\"dateTime\"]).plus({days: 7}), 'days').toObject().days.toString().substring(1, 2)}}"
}
]
},
"options": {}
},
"name": "Set",
"type": "n8n-nodes-base.set",
"typeVersion": 1,
"position": [
1140,
460
]
}
],
"connections": {
@@ -199,7 +199,7 @@
}
},
"createdAt": "2022-05-11T17:19:39.626Z",
"updatedAt": "2022-06-14T10:05:32.337Z",
"updatedAt": "2022-06-15T05:04:22.990Z",
"settings": {},
"staticData": null,
"tags": []

View File

@@ -161,7 +161,7 @@
{
"parameters": {
"chatId": "1684481",
"text": "={{$json[\"title\"]}}\n{{$json[\"date\"]}}\n{{$json[\"link\"]}}",
"text": "={{$json[\"title\"]}}\n{{$json[\"date\"]}}\n{{$json[\"link\"]}}\n#ps4games",
"additionalFields": {}
},
"name": "Telegram",
@@ -353,7 +353,7 @@
}
},
"createdAt": "2022-05-27T16:18:47.443Z",
"updatedAt": "2022-06-10T20:57:39.661Z",
"updatedAt": "2022-06-15T04:25:24.533Z",
"settings": {
"errorWorkflow": "25"
},

329
flows/33.json Normal file
View File

@@ -0,0 +1,329 @@
{
"id": 33,
"name": "Git backup of ESPHOME",
"active": false,
"nodes": [
{
"parameters": {},
"name": "Start",
"type": "n8n-nodes-base.start",
"position": [
200,
260
],
"typeVersion": 1
},
{
"parameters": {
"triggerTimes": {
"item": [
{
"hour": 0
}
]
}
},
"name": "Cron",
"type": "n8n-nodes-base.cron",
"position": [
200,
400
],
"typeVersion": 1
},
{
"parameters": {
"command": "npx n8n export:workflow --backup --output /home/node/.n8n/backup/flows/"
},
"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",
"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
],
"credentials": {
"gitPassword": {
"id": "30",
"name": "Git account"
}
}
},
{
"parameters": {
"operation": "add",
"repositoryPath": "/home/node/.n8n/backup",
"pathsToAdd": "."
},
"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",
"type": "n8n-nodes-base.ssh",
"typeVersion": 1,
"position": [
460,
280
],
"credentials": {
"sshPassword": {
"id": "33",
"name": "automation"
}
}
}
],
"connections": {
"Cron": {
"main": [
[
{
"node": "Export Workflows",
"type": "main",
"index": 0
}
]
]
},
"Start": {
"main": [
[
{
"node": "SSH",
"type": "main",
"index": 0
}
]
]
},
"Export Workflows": {
"main": [
[
{
"node": "Export Credentials",
"type": "main",
"index": 0
}
]
]
},
"Export Credentials": {
"main": [
[
{
"node": "Git3",
"type": "main",
"index": 0
}
]
]
},
"git add": {
"main": [
[
{
"node": "add username",
"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",
"settings": {
"errorWorkflow": "25"
},
"staticData": null,
"tags": [
{
"id": "2",
"name": "my",
"createdAt": "2022-05-19T09:37:15.931Z",
"updatedAt": "2022-05-19T09:37:15.931Z"
}
]
}