From 6ae5b1c5068f2200f2b5d804cbdf8588b600cf70 Mon Sep 17 00:00:00 2001 From: Benji Date: Sun, 20 Sep 2026 22:53:06 +0200 Subject: [PATCH] sync: 2026-09-20 22:53 --- update.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/update.sh b/update.sh index 3aea72d..e7db495 100755 --- a/update.sh +++ b/update.sh @@ -1,6 +1,13 @@ #!/bin/sh -TARGET_DIR="$HOME/Documents/COURS" +# 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/grond -o IdentitiesOnly=yes" # Navigate to target directory cd "$TARGET_DIR" || { @@ -8,7 +15,7 @@ cd "$TARGET_DIR" || { exit 1 } -# Pull remote changes rebase-style to prevent messy merge commits +# Pull remote changes rebase-style git pull --rebase --autostash || { echo "Git pull failed" exit 1