19 lines
568 B
Bash
Executable file
19 lines
568 B
Bash
Executable file
#!/bin/bash
|
|
|
|
# Set timezone to US Eastern (handles both EST and EDT correctly)
|
|
export TZ="America/New_York"
|
|
|
|
# Define source and destination
|
|
SOURCE="$HOME/files/media"
|
|
DEST="goji-hetzner:"
|
|
|
|
# Create timestamped log file
|
|
TIMESTAMP=$(date +"%Y-%m-%d_%H-%M-%S")
|
|
LOGFILE="$HOME/logs/rclone-sync-$TIMESTAMP.log"
|
|
|
|
# Run rclone and log output to both screen and file using tee (no --log-file!)
|
|
{
|
|
echo "=== rclone sync started at $(date) ==="
|
|
/usr/bin/rclone sync "$SOURCE" "$DEST" --log-level=INFO
|
|
echo "=== rclone sync finished at $(date) ==="
|
|
} 2>&1 | tee "$LOGFILE"
|