app : backup : include date in archive name.

This commit is contained in:
Dmitry Voronin 2023-11-03 21:04:44 +03:00
parent e6b0eb08b4
commit 992b570071

View file

@ -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'