From 992b5700712bf5ddf009a2802581bacba8b63888 Mon Sep 17 00:00:00 2001 From: home Date: Fri, 3 Nov 2023 21:04:44 +0300 Subject: [PATCH] app : backup : include date in archive name. --- app/bin/home/backup | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/bin/home/backup b/app/bin/home/backup index 38d9774..108eb5d 100755 --- a/app/bin/home/backup +++ b/app/bin/home/backup @@ -2,7 +2,8 @@ source /var/roothome/app/bin/home/shared.sh -dow=$(date +%u) # current day of week number. +dow=$(/usr/bin/date +%u) # current day of week number. +date=$(/usr/bin/date +%Y%m%d%H%M) # date stamp. path_src="/var/mnt/storage/hot" # backup src location. path_media="/var/mnt/storage/cold_1/media /var/mnt/storage/cold_2/media" # media paths. path_mount="/var/mnt/backup" # backup mount location. @@ -35,7 +36,7 @@ builtin cd "$path_src" # backup docker. rm $path_docker/${dow}_*.tar.gz -/usr/bin/tar --exclude-from=docker/.tarignore -c docker | /usr/bin/gzip -1 > $path_docker/docker.tar.gz && mv $path_docker/docker.tar.gz $path_docker/${dow}_$(/usr/bin/sha1sum $path_docker/docker.tar.gz | cut -d\ -f1).tar.gz || notify 'backup : docker failed' +/usr/bin/tar --exclude-from=docker/.tarignore -c docker | /usr/bin/gzip -1 > $path_docker/docker.tar.gz && mv $path_docker/docker.tar.gz $path_docker/${dow}_${date}-$(/usr/bin/sha1sum $path_docker/docker.tar.gz | cut -d\ -f1).tar.gz || notify 'backup : docker failed' # copy media. /usr/bin/rsync -a --delete /var/mnt/storage/hot/media/music/ /var/mnt/backup/backup/music/ || notify 'backup : copy music failed'