From 41605d4318c8d5b87378014f850c3ef1bc9c1a08 Mon Sep 17 00:00:00 2001 From: askiiart Date: Mon, 9 Oct 2023 10:00:01 -0500 Subject: [PATCH] Automated backup: 2023-10-09 10:00:01 --- backup.sh | 1 + commit.sh | 1 + create-cron-job.sh | 5 +++++ restore.sh | 1 + 4 files changed, 8 insertions(+) create mode 100755 create-cron-job.sh diff --git a/backup.sh b/backup.sh index aadc6fc..6bb6665 100755 --- a/backup.sh +++ b/backup.sh @@ -1,4 +1,5 @@ #!/usr/bin/env bash +set -e GIT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd) rm -rf $GIT_DIR/fish diff --git a/commit.sh b/commit.sh index 2f43f85..b21c6bf 100755 --- a/commit.sh +++ b/commit.sh @@ -1,4 +1,5 @@ #!/usr/bin/env bash +set -e GIT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd) cd $GIT_DIR git add . diff --git a/create-cron-job.sh b/create-cron-job.sh new file mode 100755 index 0000000..06dc556 --- /dev/null +++ b/create-cron-job.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +set -e +GIT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd) + +(crontab -l 2>/dev/null; echo "0 * * * * $GIT_DIR/commit.sh") | crontab - \ No newline at end of file diff --git a/restore.sh b/restore.sh index 1ab2d4c..1a72bf5 100644 --- a/restore.sh +++ b/restore.sh @@ -1,4 +1,5 @@ #!/usr/bin/env bash +set -e GIT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd) rm -rf $HOME/.config/fish/