Most backup advice fails at the restore step. A script that only creates archives is half a script; the other half tests that the archive can be read back.
The pattern
Use a dated archive name, a recovery record, a password from a file rather than the command line, and a test pass at the end.
- Create the archive with a 5% recovery record.
- Store the password in a protected file and pass it by reference, not as plain text in the script.
- Run a test command against the finished archive.
- Log size, duration and result to a file you review weekly.
Why the test pass matters
Disk errors often appear while writing, not while reading. A test immediately after creation catches a truncated archive the same evening instead of six months later when you need it.
Rotation without thinking
Keep seven daily archives and four weekly ones; delete by age, not by name. If your backup fits on one external drive, keep a second drive that is only connected during the backup window.
Restore drill
Once a quarter, restore a folder to a scratch directory and open a file from it. The drill takes ten minutes and is the only real proof that the script works.
