Bash and Compact Disc(CD) backups
On the previous post, I went over how to automate copying floppy disks with only providing a Title (identifier) for the image created. This script is smiliar, but uses HandBrakeCLI to query the disc in the drive for the Chapters/Titles. In this case, we are only querying the chapters in the Title 0 on the disc. HandBrake has a GUI to do this manually. #!/bin/bash NAME="UNKNOWN"; function wait_for_cd_dvd_mount() { # Query the CD/DVD Drive to see if the disc is detected blkid /dev/sr0 2&>1; last_run=$?; # If blkid's exit code is not 0(Zero), then the disc detected while [[ $last_run -ne 0 ]]; do echo "Device not mounted. Waiting..."; sleep 1; blkid /dev/sr0; last_run=$?; done } function extract_videos() { # Query all CD/DVD Titles via HandBrakeCLI (-t 0 is to scan all titles) for TITLE in $(HandBrakeCLI -i /dev/sr0 --no-dvdnav -t 0 2>&1 | grep title | grep -v...