Implemented scripts to backup repositories

This commit is contained in:
2019-12-03 13:37:39 +01:00
parent 5531b313d8
commit 6ce2ab8a31
5 changed files with 24 additions and 2 deletions

View File

@@ -10,4 +10,5 @@ DECRYPTED_PATH="$REPOSITORY_PATH/decrypted";
SCRIPT_PATH="$REPOSITORY_PATH/scripts";
DATA_PATH="$DECRYPTED_PATH/data";
BACKUP_PATH="$DECRYPTED_PATH/backup";
TEMPLATE_PATH="$REPOSITORY_PATH/templates"
TEMPLATE_PATH="$REPOSITORY_PATH/templates";
LOCAL_REPOSITORIES_PATH="$HOME/Documents/repositories";

View File

@@ -27,7 +27,6 @@ declare -a BACKUP_LIST=("$HOME/.ssh/" \
"$HOME/Documents/recovery_codes/" \
"$HOME/Documents/identity/" \
"$HOME/Documents/passwords/" \
"$HOME/Documents/repositories/application" \
"$HOME/.local/share/rhythmbox/rhythmdb.xml" \
"$HOME/.config/keepassxc/keepassxc.ini");
for system_item_path in "${BACKUP_LIST[@]}";

View File

@@ -0,0 +1,6 @@
#!/bin/bash
#
# Pushs all repositories
# @author Kevin Veen-Birkenbach [aka. Frantz]
source "$(dirname "$(readlink -f "${0}")")/base.sh"
bash "$SCRIPT_PATH/push-local-repositories.sh" push

View File

@@ -0,0 +1,13 @@
#!/bin/bash
#
# Pushs all repositories
# @param $1 git command which should be executed instead of default pull
# @author Kevin Veen-Birkenbach [aka. Frantz]
source "$(dirname "$(readlink -f "${0}")")/base.sh"
if [ $# -eq 1 ]
then
git_command=$1
else
git_command="push"
fi
find $LOCAL_REPOSITORIES_PATH -maxdepth 1 -mindepth 1 -type d -exec bash -c "(cd {} && echo 'In directory: {}' && git status && echo 'Executes git $git_command' && git $git_command --all)" \;