I have a library of movies, TV shows and music for local hosting. Right now I have a script that uses cp to copy newly added media files to a second, identical drive in another room as a backup. there has to be a better way to do this.
ignoring cloud storage and RAID, what are some command line tools that could ensure that the integrity of the files remains intact? assuming the drive continues to function properly.
backups will depend lots on your setup and how far you want to go with it. if you use filesystems like btrfs or zfs you can copy snapshots (across different computers, multiple disks in the same computer, across the web). there are tools dedicated to backup like borg that tries to simplify the whole process. if you want to diy, you can use rsync to do checksumming and copying only new or different files. you can even do snapshot-like backups with a bit of effort.
regardless of the method you use, keep in mind backups are for when things go wrong. ensure they are accesible to you whenever you need them (physically accesible, you have the keys if you chose to encrypt them, the hardware is in good state, things like that). people tend to recommend to keep at least 3 copies in two different formats and one in a different physical place (also known as the 3-2-1 rule) in case you loose two copies at the same time (in case of natural disaster for example).