Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .jules/sentinel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Sentinel Journal

This journal records CRITICAL security learnings from the codebase.
format: `## YYYY-MM-DD - [Title]
**Vulnerability:** [What you found]
**Learning:** [Why it existed]
**Prevention:** [How to avoid next time]`
2 changes: 1 addition & 1 deletion cron/backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ set -e
# Paths
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
DOTFILES_DIR="$(dirname "$SCRIPT_DIR")"
BACKUP_SCRIPT="$DOTFILES_DIR/scripts/backup/backup-projects.sh"
BACKUP_SCRIPT="$DOTFILES_DIR/tools/backup-projects.sh"
LOG_DIR="${XDG_STATE_HOME:-$HOME/.local/state}/dotfiles"
LOG_FILE="$LOG_DIR/backup-cron.log"
BACKUP_DIR="${XDG_DATA_HOME:-$HOME/.local/share}/dotfiles/backups"
Expand Down
21 changes: 10 additions & 11 deletions tools/backup-projects.sh
Original file line number Diff line number Diff line change
Expand Up @@ -234,11 +234,10 @@ parse_args() {

# --- Build Exclude Arguments for Zip ---
build_exclude_args() {
local args=()
EXCLUDE_ARGS=()
for pattern in "${EXCLUDE_PATTERNS[@]}"; do
args+=("-x" "*/${pattern}/*" "-x" "*/${pattern}")
EXCLUDE_ARGS+=("-x" "*/${pattern}/*" "-x" "*/${pattern}")
done
echo "${args[@]}"
}

# --- Git Sync ---
Expand Down Expand Up @@ -351,10 +350,12 @@ cmd_backup() {
# Setup directories
if [[ "$DRY_RUN" != true ]]; then
mkdir -p "$BACKUP_TEMP_DIR"
chmod 700 "$BACKUP_TEMP_DIR"
mkdir -p "$LOG_DIR"
chmod 700 "$LOG_DIR"
else
debug "Would create: $BACKUP_TEMP_DIR"
debug "Would create: $LOG_DIR"
debug "Would create: $BACKUP_TEMP_DIR (mode 700)"
debug "Would create: $LOG_DIR (mode 700)"
fi

# Sync git repositories first
Expand Down Expand Up @@ -406,17 +407,15 @@ cmd_backup() {
done
fi
else
local exclude_args
exclude_args=$(build_exclude_args)
build_exclude_args

(
cd "$HOME" || exit 1
umask 077
if [[ "$VERBOSE" == true ]]; then
# shellcheck disable=SC2086
zip -r "$archive_path" "${relative_paths[@]}" $exclude_args
zip -r "$archive_path" "${relative_paths[@]}" "${EXCLUDE_ARGS[@]}"
else
# shellcheck disable=SC2086
zip -r -q "$archive_path" "${relative_paths[@]}" $exclude_args
zip -r -q "$archive_path" "${relative_paths[@]}" "${EXCLUDE_ARGS[@]}"
fi
)

Expand Down
Loading