add basic music library sync check script
This commit is contained in:
parent
94eb79d5c6
commit
dd4bc277d1
|
@ -21,6 +21,29 @@ in {
|
||||||
'')
|
'')
|
||||||
];
|
];
|
||||||
|
|
||||||
|
home.file."Music/music-sync-check.sh" = {
|
||||||
|
executable = true;
|
||||||
|
text = ''
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
SCRIPT_DIR=$( cd -- "$( dirname -- "''${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||||||
|
cd "''${SCRIPT_DIR}"
|
||||||
|
|
||||||
|
ERROR_LOG=$(mktemp -t music-check-log-XXX)
|
||||||
|
|
||||||
|
echo "Checking StorageBox sync status"
|
||||||
|
if rclone check . Storage:Music --exclude "/*.sh" 2>$ERROR_LOG; then
|
||||||
|
echo "Up to date with StorageBox"
|
||||||
|
else
|
||||||
|
echo "An error occured attempting to check sync status:"
|
||||||
|
cat "$ERROR_LOG"
|
||||||
|
echo
|
||||||
|
fi
|
||||||
|
|
||||||
|
rm "$ERROR_LOG"
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
home.file."Music/music-sync.sh" = {
|
home.file."Music/music-sync.sh" = {
|
||||||
executable = true;
|
executable = true;
|
||||||
text = ''
|
text = ''
|
||||||
|
@ -29,7 +52,7 @@ in {
|
||||||
SCRIPT_DIR=$( cd -- "$( dirname -- "''${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
SCRIPT_DIR=$( cd -- "$( dirname -- "''${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||||||
cd "''${SCRIPT_DIR}"
|
cd "''${SCRIPT_DIR}"
|
||||||
|
|
||||||
rclone sync -P . Storage:Music --exclude music-sync.sh,music-download.sh
|
rclone sync -P . Storage:Music --exclude "/*.sh"
|
||||||
restic-music backup $(fd -t d --max-depth=1 && fd -t f --max-depth=1)
|
restic-music backup $(fd -t d --max-depth=1 && fd -t f --max-depth=1)
|
||||||
|
|
||||||
TITLE="chaos's Music Library"
|
TITLE="chaos's Music Library"
|
||||||
|
|
Loading…
Reference in a new issue