From bb27675ab3157d8b501d109afe927770b9062ba4 Mon Sep 17 00:00:00 2001 From: Benji Date: Mon, 28 Sep 2026 18:51:39 +0200 Subject: [PATCH] sync: 2026-09-28 18:51 --- test.txt | 36 ------------------------------------ 1 file changed, 36 deletions(-) delete mode 100644 test.txt diff --git a/test.txt b/test.txt deleted file mode 100644 index 4dbde1d..0000000 --- a/test.txt +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh - -# Set PATH so cron can find git, date, ssh, etc. -export PATH="/usr/local/bin:/usr/bin:/bin" - -# Explicitly set target directory (don't rely on $HOME in cron) -TARGET_DIR="/home/benji/Documents/COURS" - -# If using SSH keys, specify the key for Git -export GIT_SSH_COMMAND="ssh -i /home/benji/.ssh/git -o IdentitiesOnly=yes" - -# Navigate to target directory -cd "$TARGET_DIR" || { - echo "Directory not found" - exit 1 -} - -# Pull remote changes rebase-style -git pull --rebase --autostash || { - echo "Git pull failed" - exit 1 -} - -# Stage all files -git add -A - -# Commit only if there are actual changes staged -if ! git diff-index --quiet HEAD --; then - git commit -m "sync: $(date +'%Y-%m-%d %H:%M')" - git push || { - echo "Git push failed" - exit 1 - } -else - echo "No changes to commit." -fi