Update backup-files.sh

Modificacion del LOG:
- Se modificó la configuración del log para que se sobreescriba evitando un archivo muy grande.
-Ademas se agregó la fecha y hora en la que se crea el log.
-Tambien se cambio el path del log a "HOME/backup-disk.log".
This commit is contained in:
Facundo Carroz
2025-10-07 23:42:42 -03:00
committed by GitHub
parent 33d4a8a5db
commit 8375bfddf3

View File

@@ -4,7 +4,7 @@
set -euo pipefail
# Save log
exec > >(tee -a /var/log/backup.log) 2>&1
exec > >(tee "$HOME/backup-disk.log") 2>&1
# Paths
# Unmount disk after save backup
@@ -38,11 +38,15 @@ perform_backup() {
fi
# Execute rsync
echo
echo "Starting backup $origin -> $destination"
rsync -av --delete "$origin/" "$destination/"
echo "Backup successfully saved $origin on $destination"
}
# Init log
echo "===== Backup created: $(date '+%Y-%m-%d %H:%M:%S') ====="
echo
# The mount point disk not exists
if [ ! -d "$backup_path" ]; then