From 8375bfddf33351c9b4829a8b9907a00ab260b100 Mon Sep 17 00:00:00 2001 From: Facundo Carroz Date: Tue, 7 Oct 2025 23:42:42 -0300 Subject: [PATCH] Update backup-files.sh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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". --- backup-files.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/backup-files.sh b/backup-files.sh index 8c4d132..a02b2e0 100755 --- a/backup-files.sh +++ b/backup-files.sh @@ -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