samuelncui / yatm

Yet Another Tape Manager - Full Functional Tape Management System with Web User Interface
BSD 2-Clause "Simplified" License
179 stars 5 forks source link

Multiple backup jobs on a single tape #12

Open aaron2198 opened 7 months ago

aaron2198 commented 7 months ago

I was wondering if there is a limitation when performing a backup job to the same tape, here are the steps that I did:

  1. I initially archived a small batch of content as a test
  2. performed a few restores to learn how the tools worked
  3. attempted to perform a backup job to the same tape with the same barcode and name (just trying to append data)
  4. The job started and the logs seemed to state formatting and adding partitions a and b (I am a noob but this sounds like erasing, I let it go)
  5. several hours later I am hit with this DB constraint warning (if this is an intended limitation, I can look into a PR for a pre-check on this so it doesn't tell you after erasing and writing)
    time="2024-03-25T23:39:24-04:00" level=error msg="make tape has error, barcode= 'BLU000' name= 'BLU000'" error="create tape fail, barcode= 'BLU000' name= 'BLU000', save tape fail, err= constraint failed: UNIQUE constraint failed: tapes.barcode (2067)"

If this is intended behaviour, do you think it would be possible to allow appending data to an existing tape when you don't have enough data to fill it upfront? I understand there may be other complexities. I haven't investigated what happens if you enqueue a backup job that exceeds your tape's capacity, does the tool allow "continuation" on the next tape?

Thanks for this great project, it is great for smaller more arbitrary archiving. I am interested in trying to contribute if help is needed anywhere!

samuelncui commented 7 months ago

You can delete the old tape record (which means deleting the library records of files inside it), and create a new job (will overwrite the old content on the tape).

This software doesn't have 'appending' feature yet, so you must overwrite the old records.