dotfiles/home/default/scripts/sync-mp3-player

22 lines
620 B
Plaintext
Raw Permalink Normal View History

2024-05-23 11:30:18 -04:00
#!/usr/bin/env sh
set -eou pipefail
2024-08-16 20:20:17 -04:00
sudo mkdir -p /run/media/default
echo "mounting /run/media/default/MUSIC"
2024-11-02 15:38:09 -04:00
sudo fsck -fy /dev/disk/by-uuid/4619-9B49 || true
sudo mkdir -p /run/media/default/MUSIC || true
sudo mount -U 4619-9B49 /run/media/default/MUSIC
2024-05-23 11:30:18 -04:00
echo "syncing music..."
2024-11-02 15:38:09 -04:00
sudo rsync --info=progress2 -W -r --delete /home/default/Music/* /run/media/default/MUSIC/
2024-08-16 20:20:17 -04:00
sudo sync /run/media/default/MUSIC/
2024-05-23 11:30:18 -04:00
cd /run/media/default/MUSIC
2024-11-02 15:38:09 -04:00
sudo /home/default/scripts/generate-playlists
2024-05-23 11:30:18 -04:00
cd /home/default
echo "unmounting /run/media/default/MUSIC"
sudo umount /run/media/default/MUSIC
sudo rmdir /run/media/default/MUSIC