diff --git a/home_backup.sh b/home_backup.sh index f8dcd83..050c454 100755 --- a/home_backup.sh +++ b/home_backup.sh @@ -5,13 +5,13 @@ # Parameters # --- $1 = Time schedule ('hourly' | 'daily' | 'weekly' | 'monthly') -USER=thomas -export XDG_RUNTIME_DIR=/run/user/1000 -source /home/thomas/.env +#USER=thomas +#export XDG_RUNTIME_DIR=/run/user/1000 +#source /home/thomas/.env SCHEDULE=$1 THIS_FILE=${0} -SLACK_NOTIFIER="/home/thomas/repos/utilities/slack_notifier.sh" +SLACK_NOTIFIER="${HOME}/repos/utilities/slack_notifier.sh" if mountpoint -q /media/samsung-T3; then ERROR=$(sudo /usr/bin/rsnapshot -c /etc/rsnapshot.conf hourly 2>&1) diff --git a/music_sync/backup_music_library.sh b/music_sync/backup_music_library.sh index 6270e71..7bfee2a 100755 --- a/music_sync/backup_music_library.sh +++ b/music_sync/backup_music_library.sh @@ -1,7 +1,7 @@ #!/bin/bash THIS_FILE=${0} -SLACK_NOTIFIER="/home/thomas/repos/utilities/slack_notifier.sh" +SLACK_NOTIFIER="${HOME}/repos/utilities/slack_notifier.sh" FILE_NAME=$(date +%Y-%m-%d_%H:%M:%S-%Z) BAK=$(ls -dt "/media/crucial/music/"*"music_lib_bak"* | head -n 1) TEMP="/media/crucial/music/temp" diff --git a/music_sync/update_music_library.sh b/music_sync/update_music_library.sh index 0a5b954..447e17f 100755 --- a/music_sync/update_music_library.sh +++ b/music_sync/update_music_library.sh @@ -4,11 +4,13 @@ BLUE='\033[0;34m' NO_COLOR='\033[0m' echo -e "${BLUE}INFO Syncing music library to DAP SD card...${NO_COLOR}" -/home/thomas/repos/utilities/music_sync/transfer_to_DAP.sh +"${HOME}/repos/utilities/music_sync/transfer_to_DAP.sh" sleep 3 echo -e "${BLUE}INFO Backing up music library to additional external drive...${NO_COLOR}" -/home/thomas/repos/utilities/music_sync/backup_music_library.sh +"${HOME}/repos/utilities/music_sync/backup_music_library.sh" + +# /home/thomas/repos/utilities/music_sync/backup_music_library.sh echo -e "${BLUE}INFO Backup completed...${NO_COLOR}" diff --git a/slack_notifier.sh b/slack_notifier.sh index 5dfd99f..bd71366 100755 --- a/slack_notifier.sh +++ b/slack_notifier.sh @@ -63,7 +63,7 @@ ERROR_BLOCKS=$( ) # Initialise sound playback -mpv --volume=0 --start=0 --length=0.1 /home/thomas/dotfiles/gruvbox-95/sounds/st-computer-on.mp3 +mpv --volume=0 --start=0 --length=0.1 "${HOME}/dotfiles/gruvbox-95/sounds/st-computer-on.mp3" sleep 1 # Process notification @@ -72,11 +72,11 @@ if [ "$2" != "error" ]; then -H 'Content-type: application/json' \ --data '{"text":"🟢 '"$3"'"}' \ "$WEBHOOK" - mpv --volume=100 /home/thomas/dotfiles/sounds/star-trek-computer-success.mp3 + mpv --volume=100 "${HOME}/dotfiles/sounds/star-trek-computer-success.mp3" else curl -X POST \ -H 'Content-type: application/json' \ --json "$ERROR_BLOCKS" \ "$WEBHOOK" - mpv --volume=100 /home/thomas/dotfiles/sounds/star-trek-computer-error.mp3 + mpv --volume=100 "${HOME}/dotfiles/sounds/star-trek-computer-error.mp3" fi