extern - Music File Exporter

This module copies music files to external storages. During the copy process, transcoding and fixing invalid meta-tags will be done. More details about the post-processing can be found in MusicDBExtern. To use this module properly, the following workflow is recommended:

  1. Mount device. The by-id method is recommended.

  2. Make sure to have write permission to the related directories

  3. Run musicdb extern

  4. Unmount the device

To initialize a storage device, the -i/--init flag must be set. More details about the init-process can be found in MusicDBExtern.

For updating the -u/--update flag must be set. It is also possible to apply both flags. When using both flags at the same time, you are not able to apply any configuration changes before uploading the music file!

Be sure to have write permission for the related directories.

Warning

If -i is set, the device gets initialized, even if it already is!

Before anything is done, the module checks for dependencies that are optional for MusicDB but required for this particular module using the CheckForDependencies(). They are ffmpeg and id3edit <https://github.com/rstemmer/id3edit>_.

Examples

Initialize a new storage:

mount /dev/sdx1 /mnt

# Initialize storage
musicdb extern -i /mnt
# -i/--init: initialize storage

umount /mnt

Updating the storage:

mount /dev/sdx1 /mnt

# Update storage
musicdb extern -u /mnt
# -u/--update: update storage

umount /mnt

File Export to External Device

It is recommended to write a short script to automate the update-process. The following script mounts a SD-Card and runs the update-process.

#!/usr/bin/env bash

# Path to the storage device that shall be updated
DEVICE="/dev/disk/by-id/usb-SD_USB3_Reader_000000000002-0:2-part1"

if [ ! -L "$DEVICE" ] ; then
  echo -e "\e[1;31mDevice \"$DEVICE\" does not exist!\e[0m"
  exit 1
fi

echo -e "\e[1;34mRunning update …\e[0m"

sudo mount $DEVICE /mnt
musicdb extern -u /mnt
sudo umount /mnt

echo -e "\e[1;37mupdate complete\e[0m"

exit 0