3 # musical_wand: distributes music from our primary source to all hosts that are listed
4 # as being redundant copies for the music.
6 # this script is designed to be run on the music host with the super alpha main source of
7 # music plugged in as an external drive. that being said, it will still work as long as
8 # the music host has its local copy intact; the local copy of the primary is always what
9 # is synched onto the other archive hosts. in that sense, the musical host is itself a
10 # musix archive, but it is treated "special".
12 source "$FEISTY_MEOW_SCRIPTS/core/functions.sh"
14 #hmmm: add the goodness around these actions like the "nice" updater so we catch all errors.
16 # this host is where all the music is supposed to come from.
19 #hmmm: this script is currently limited to run ON the music host. it could easily do the backwards thing instead, and copy FROM music host.
21 # the list of hosts we know of that are holding onto duplicate copies of the musix archive.
22 #old list MUSIX_ARCHIVE_SITE_LIST=(surya banshee wildmutt euphrosyne)
23 MUSIX_ARCHIVE_SITE_LIST=(euphrosyne)
24 #hmmm: list was contracted a lot, since we don't want to step on the updates done by syncthing. euphrosyne is still our reference copy for what the archive states "should" be.
27 if [[ ! ( $(hostname) =~ .*${MUSICAL_HOST}.* ) ]]; then
28 echo "This script is only designed to run on $MUSICAL_HOST with the"
29 echo "primary fred music source (external) disc plugged in."
33 # synch our local copy on the music host with the primary music drive, source of all goodness.
34 function get_music_from_alpha_site()
37 echo "getting musix and basement from fred music prime device"
38 rsync -av /media/fred/fredmusicprime/musix/* /z/musix/
39 rsync -av /media/fred/fredmusicprime/basement/* /z/basement/
44 # updates the music on a remote host to our current local copy on the music host.
45 function update_musix_pile()
48 local host="$1"; shift
49 echo "$host: synching musix and basement"
50 rsync -avz /z/musix/* ${host}:/z/musix/
51 rsync -avz /z/basement/* ${host}:/z/basement/
58 # make sure the local machine, our first-stop musix host, is in good shape.
59 get_music_from_alpha_site
61 # run through the steps of updating all our machines.
62 for i in ${MUSIX_ARCHIVE_SITE_LIST[@]}; do