diff options
Diffstat (limited to 'sync_tt_to_alt.sh')
| -rwxr-xr-x | sync_tt_to_alt.sh | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/sync_tt_to_alt.sh b/sync_tt_to_alt.sh new file mode 100755 index 0000000..1d94d4a --- /dev/null +++ b/sync_tt_to_alt.sh @@ -0,0 +1,14 @@ +#!/bin/bash +# === Sync /home/tt from Montreal to Linode === + +# Vars +SOURCE="/home/tt/" +DESTINATION="root@172.238.63.162:/home/tt/" +LOG_FILE="/var/log/tt_sync.log" +DATE=$(date '+%Y-%m-%d %H:%M:%S') + +# Rsync command - preserves perms, ownership, etc. +rsync -az --delete "$SOURCE" "$DESTINATION" >> "$LOG_FILE" 2>&1 + +# Logging +echo "[$DATE] Sync completed" >> "$LOG_FILE" |
