-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
73ab7dd
commit 121ae45
Showing
3 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
# Pull or clone multiple git repositories to backup folder | ||
|
||
TARGET_DIR="$HOME/backup" | ||
REPO_FILE="$HOME/.dotfiles/secrets/backup_repos_list.txt" | ||
|
||
readarray -t REPO_LIST < "$REPO_FILE" | ||
for REPO_URL in "${REPO_LIST[@]}"; do | ||
REPO_NAME=$(basename -s .git "$REPO_URL") | ||
REPO_DIR="$TARGET_DIR/$REPO_NAME" | ||
if [ -d "$REPO_DIR" ]; then | ||
echo "Updating repository: $REPO_NAME" | ||
git -C "$REPO_DIR" pull | ||
else | ||
echo "Cloning repository: $REPO_NAME" | ||
git clone "$REPO_URL" "$REPO_DIR" | ||
fi | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
# Seagate backup | ||
# ensure the repo is set up via: | ||
# restic init --repo /media/max/Seagate/restic/ | ||
|
||
. ~/.dotfiles/secrets/passwords/restic | ||
|
||
export RESTIC_REPOSITORY=/media/max/Seagate/restic | ||
export RESTIC_PASSWORD=$PWD_SEAGATE_FIRECUDA | ||
|
||
# TODO stop syncthing | ||
|
||
bash ~/.dotfiles/bin/pull_repo_list_to_backup | ||
restic backup --option compression=max --files-from ~/.dotfiles/secrets/backup_dirs_list.txt | ||
|
||
# TODO start syncthing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
# Local backup | ||
# ensure the repo is set up via: | ||
# restic init --repo /home/max/repos/tools/restic | ||
|
||
. ~/.dotfiles/secrets/passwords/restic | ||
|
||
export RESTIC_REPOSITORY=/home/max/repos/tools/restic | ||
export RESTIC_PASSWORD=$PWD_LOCAL | ||
|
||
# TODO stop syncthing | ||
|
||
bash ~/.dotfiles/bin/pull_repo_list_to_backup | ||
restic backup --option compression=max --files-from ~/.dotfiles/secrets/backup_dirs_list.txt | ||
|
||
# TODO start syncthing |