From 917a3059f3b2f95f092e5fe1e9cf60c516bc8421 Mon Sep 17 00:00:00 2001 From: Benny Saret Date: Mon, 17 Jul 2023 10:41:34 +0300 Subject: [PATCH] upload scripts of the libre server --- scwipts/dumpdata | 4 ++++ scwipts/rebooting | 2 ++ scwipts/ssh.sh | 4 ++++ scwipts/weekly_db_copy | 5 +++++ 4 files changed, 15 insertions(+) create mode 100644 scwipts/dumpdata create mode 100644 scwipts/rebooting create mode 100644 scwipts/ssh.sh create mode 100644 scwipts/weekly_db_copy diff --git a/scwipts/dumpdata b/scwipts/dumpdata new file mode 100644 index 0000000..40e3da0 --- /dev/null +++ b/scwipts/dumpdata @@ -0,0 +1,4 @@ +#!/bin/bash +pushd /bck +mongodump "mongodb://admin:anakuanaenkiduibriabakki@db.saret.tk:27017/" +curl https://ntfy.d.metallum.eu.org/MiniServer -d "run backup of the server and the db." diff --git a/scwipts/rebooting b/scwipts/rebooting new file mode 100644 index 0000000..027bc63 --- /dev/null +++ b/scwipts/rebooting @@ -0,0 +1,2 @@ +#!/bin/bash +ntfy pub -t "started up, Libre – Toy server" -m "$(date)" https://ntfy.d.metallum.eu.org/ServerState diff --git a/scwipts/ssh.sh b/scwipts/ssh.sh new file mode 100644 index 0000000..ac0b1fe --- /dev/null +++ b/scwipts/ssh.sh @@ -0,0 +1,4 @@ +#!/bin/bash +if [[ "$(ps -x |grep saret@ssh |awk '{print $9}')" != *"libre-computer:22:localhost:22"* ]]; then + ssh saret@ssh-j.com -N -R libre-computer:22:localhost:22 +fi diff --git a/scwipts/weekly_db_copy b/scwipts/weekly_db_copy new file mode 100644 index 0000000..ddd7659 --- /dev/null +++ b/scwipts/weekly_db_copy @@ -0,0 +1,5 @@ +#!/bin/bash +scp oracle:~/DB/db.7z /bck/$(date +'%Y-%m-%d').7z +curl https://ntfy.d.metallum.eu.org/Saretify -H 'Content-Type: application/json' -d @/dev/stdin<