Fix scripts, add missing

This commit is contained in:
octospacc 2023-01-17 10:53:57 +01:00
parent 8e036f308c
commit bb745d8d0d
5 changed files with 38 additions and 4 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*.sec
.*.sec

View File

@ -8,4 +8,16 @@ BackupsBase="/media/Disk/Backup"
RunDate="$(date +%F)"
cd "${BackupsBase}"
source ./.BackupSecrects.cfg
. ./.BackupSecrects.sec
Hash2() {
BaseKey="$1"
SecStr="$2"
echo "$(echo "${BaseKey}$(echo "${SecStr}" | sha512sum | base64 -w0)" | sha512sum | base64 -w0)"
}
ccencryptNow() {
File="$1"
BaseKey="$2"
ccrypt -e -K"$(Hash2 "${BaseKey}" "${RunDate}")" "${File}"
}

View File

@ -1,7 +1,7 @@
#!/bin/sh
# Upload a backup of the Local Cloud and of local services backups to other clouds
source ./BackupGlobals.cfg
. "$(dirname "$(realpath "$0")")/BackupGlobals.cfg"
GitPush() {
git add .
@ -9,7 +9,13 @@ GitPush() {
git push
}
#Server-Backup-Limited
cd ./Server-Backup-Limited
#mkdir -p ./tmp && cd ./tmp
Item="Invidious-User" && cp "../../${Item}/Latest.7z" "./${Item}.7z" && ccencryptNow "./${Item}.7z" "${BackupKey_Git_Invidious}"
Item="wallabag-data" && cp "../../${Item}/Latest.tar.xz" "./${Item}.tar.xz" && ccencryptNow "./${Item}.tar.xz" "${BackupKey_Git_wallabag}"
Item="FreshRSS-data" && cp "../../${Item}/Latest.tar.xz" "./${Item}.tar.xz" && ccencryptNow "./${Item}.tar.xz" "${BackupKey_Git_FreshRSS}"
GitPush
cd ..
#CloudDir="/home/octo/Cloud"
#cd "$CloudDir"

View File

@ -0,0 +1,14 @@
#!/bin/sh
# Make local backups of our data from various third-party services
. "$(dirname "$(realpath "$0")")/BackupGlobals.cfg"
# Invidious personal JSON dump
Name="Invidious-User"
mkdir -p "./${Name}"
curl \
"${Invidious_Backup_URL}/subscription_manager?action_takeout=1&format=json" \
-H "${Invidious_Backup_Cookie}" \
| 7z a -mmt1 -mx9 "./${Name}/${RunDate}.7z" -si && cp "./${Name}/${RunDate}.7z" "./${Name}/Latest.7z"
date > "${BackupsBase}/Last.log"

View File

@ -1,7 +1,7 @@
#!/bin/sh
# Make local backups of the data from the hosted services
source ./BackupGlobals.cfg
. "$(dirname "$(realpath "$0")")/BackupGlobals.cfg"
SimpleBackup() {
mkdir -p "./$1"