From 02affa283cf52fbe3673cc804a5b368d9a65014d Mon Sep 17 00:00:00 2001 From: martin Date: Fri, 17 May 2024 09:38:59 +0000 Subject: [PATCH] Init --- fstab | 20 ++++++++++++++++++++ hosts | 9 +++++++++ ip.txt | 15 +++++++++++++++ playlister.sh | 12 ++++++++++++ root/backup.sh | 11 +++++++++++ root/makePlaylists.sh | 18 ++++++++++++++++++ root/playlister.sh | 12 ++++++++++++ root/rclone-kill.sh | 7 +++++++ root/rclone-sync-music.sh | 10 ++++++++++ root/rclone-sync-radio.sh | 10 ++++++++++ smb | 3 +++ 11 files changed, 127 insertions(+) create mode 100644 fstab create mode 100644 hosts create mode 100644 ip.txt create mode 100755 playlister.sh create mode 100755 root/backup.sh create mode 100755 root/makePlaylists.sh create mode 100755 root/playlister.sh create mode 100755 root/rclone-kill.sh create mode 100755 root/rclone-sync-music.sh create mode 100755 root/rclone-sync-radio.sh create mode 100644 smb diff --git a/fstab b/fstab new file mode 100644 index 0000000..4ea3afe --- /dev/null +++ b/fstab @@ -0,0 +1,20 @@ +# /etc/fstab: static file system information. +# +# Use 'blkid' to print the universally unique identifier for a +# device; this may be used with UUID= as a more robust way to name devices +# that works even if disks are added and removed. See fstab(5). +# +# +# / was on /dev/ubuntu-vg/ubuntu-lv during curtin installation +/dev/disk/by-id/dm-uuid-LVM-1R92Iz6hgac2vubjCtsj2kcOh4acnw7t4NZPcE2Xu5XPS3kd5tL5XfX3o2S1PBQI / btrfs defaults,noatime,autodefrag,compress=zstd 0 1 +# /boot was on /dev/sda2 during curtin installation +/dev/disk/by-uuid/621f555d-caf0-40cb-910e-439b6c0bf48c /boot ext4 defaults 0 1 +/swap.img none swap sw 0 0 + + +UUID=19dfe6ec-9f9f-45f0-a375-662d01551303 /data btrfs defaults,noatime,compress=lzo,commit=120 0 0 + + +//192.168.0.204/musicBackup/ /mnt/backup-music/ cifs uid=1000,gid=1000,credentials=/root/.smb,file_mode=0755,dir_mode=0755,noauto,x-systemd.automount,x-systemd.mount-timeout=30,_netdev 0 0 + + diff --git a/hosts b/hosts new file mode 100644 index 0000000..326bbf7 --- /dev/null +++ b/hosts @@ -0,0 +1,9 @@ +127.0.0.1 localhost +127.0.1.1 music + +# The following lines are desirable for IPv6 capable hosts +::1 ip6-localhost ip6-loopback +fe00::0 ip6-localnet +ff00::0 ip6-mcastprefix +ff02::1 ip6-allnodes +ff02::2 ip6-allrouters diff --git a/ip.txt b/ip.txt new file mode 100644 index 0000000..b4ad3d7 --- /dev/null +++ b/ip.txt @@ -0,0 +1,15 @@ +1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 + link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 + inet 127.0.0.1/8 scope host lo + valid_lft forever preferred_lft forever + inet6 ::1/128 scope host + valid_lft forever preferred_lft forever +2: ens18: mtu 1500 qdisc fq_codel state UP group default qlen 1000 + link/ether 0e:38:cb:de:d1:54 brd ff:ff:ff:ff:ff:ff + altname enp6s18 + inet 192.168.1.162/23 brd 192.168.1.255 scope global ens18 + valid_lft forever preferred_lft forever + inet6 fe80::c38:cbff:fede:d154/64 scope link + valid_lft forever preferred_lft forever + + diff --git a/playlister.sh b/playlister.sh new file mode 100755 index 0000000..7512ea8 --- /dev/null +++ b/playlister.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +echo "Scanning ${1}" + +cd ${1} + +find "." -type f -iregex ".*\.\(mp4\|mp3\|avi\|m4v\|aac\|mkv\|mov\|webm\|wmv\|flv\|m4a\)" -fprint ${2}.m3u + +# find "." -type f -iregex ".*\.\(mp4\|mp3\|avi\|m4v\|aac\|mkv\|mov\|webm\|wmv\|flv\|m4a\)" -printf "%T@ ./%f\n" | sort | cut -d' ' -f2 > ${2}.m3u + + + diff --git a/root/backup.sh b/root/backup.sh new file mode 100755 index 0000000..9238107 --- /dev/null +++ b/root/backup.sh @@ -0,0 +1,11 @@ +#!/bin/bash + + +# /usr/bin/rsync -auzvhq /data/media/music/ 192.168.0.204::music + +#/usr/bin/rsync -auzvh --stop-after=360 --progress --delete --delete-excluded --ignore-errors --exclude ".recycle" /data/media/music/ 192.168.0.204::music + +/usr/bin/rsync -aAXuzvvvhq --stop-after=360 --progress --delete --delete-excluded --ignore-errors --exclude ".recycle" /data/media/music/ 192.168.0.204::music + + +/usr/bin/curl --retry 3 https://hc-ping.com/3dc35c71-37bf-448c-964b-670beccb5ebf/$? diff --git a/root/makePlaylists.sh b/root/makePlaylists.sh new file mode 100755 index 0000000..7aa9a34 --- /dev/null +++ b/root/makePlaylists.sh @@ -0,0 +1,18 @@ +#!/bin/bash + + +/root/playlister.sh /data/media/music/Ambient Ambient + +/root/playlister.sh /data/media/music/NSBRadio NSBRadio +/root/playlister.sh /data/media/music/Synthwave Synthwave +/root/playlister.sh /data/media/music/Downtempo Downtempo +/root/playlister.sh /data/media/music/Triphop Triphop +/root/playlister.sh /data/media/music/Cyberpunk Cyberpunk +/root/playlister.sh /data/media/music/Dubstep Dubstep +/root/playlister.sh /data/media/music/Breakbeat Breakbeat +/root/playlister.sh /data/media/music/mixes Mixes +/root/playlister.sh /data/media/music/MarcRiley MarcRiley +/root/playlister.sh /data/media/music/lofi LoFi +/root/playlister.sh /data/media/music/chillstep Chillstep +/root/playlister.sh /data/media/music/Angelo_Coppola Latest_In_Paleo + diff --git a/root/playlister.sh b/root/playlister.sh new file mode 100755 index 0000000..7512ea8 --- /dev/null +++ b/root/playlister.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +echo "Scanning ${1}" + +cd ${1} + +find "." -type f -iregex ".*\.\(mp4\|mp3\|avi\|m4v\|aac\|mkv\|mov\|webm\|wmv\|flv\|m4a\)" -fprint ${2}.m3u + +# find "." -type f -iregex ".*\.\(mp4\|mp3\|avi\|m4v\|aac\|mkv\|mov\|webm\|wmv\|flv\|m4a\)" -printf "%T@ ./%f\n" | sort | cut -d' ' -f2 > ${2}.m3u + + + diff --git a/root/rclone-kill.sh b/root/rclone-kill.sh new file mode 100755 index 0000000..711db30 --- /dev/null +++ b/root/rclone-kill.sh @@ -0,0 +1,7 @@ +#!/bin/bash +/usr/bin/killall -s QUIT rclone + + +/usr/bin/sleep 60 + +/usr/bin/killall -s KILL rclone diff --git a/root/rclone-sync-music.sh b/root/rclone-sync-music.sh new file mode 100755 index 0000000..4730437 --- /dev/null +++ b/root/rclone-sync-music.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +/usr/bin/curl -X POST -H "Content-Type: application/json" --data "{ \"server\": \"Musicserver\", \"error\": \"{error:'Music Backup Started'}\" }" https://error.caliban.io/error + + +/usr/bin/rclone sync --delete-during /data/media/music/ /mnt/backup-music/music + +/usr/bin/curl -X POST -H "Content-Type: application/json" --data "{ \"server\": \"Musicserver\", \"error\": \"{error:'Music Backup Stopped $?'}\" }" https://error.caliban.io/error +/usr/bin/curl --retry 3 https://hc-ping.com/3dc35c71-37bf-448c-964b-670beccb5ebf/$? + diff --git a/root/rclone-sync-radio.sh b/root/rclone-sync-radio.sh new file mode 100755 index 0000000..c8a7bb9 --- /dev/null +++ b/root/rclone-sync-radio.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +/usr/bin/curl -X POST -H "Content-Type: application/json" --data "{ \"server\": \"Musicserver\", \"error\": \"{error:'Radio Backup Started'}\" }" https://error.caliban.io/error + + +/usr/bin/rclone sync --delete-during /data/media/station_store/ /mnt/backup-music/radio + +/usr/bin/curl -X POST -H "Content-Type: application/json" --data "{ \"server\": \"Musicserver\", \"error\": \"{error:'Radio Backup Stopped $?'}\" }" https://error.caliban.io/error + + diff --git a/smb b/smb new file mode 100644 index 0000000..ced609c --- /dev/null +++ b/smb @@ -0,0 +1,3 @@ +username=martin +password=Texas.Venus.372 +