All jobs / Database administrator / Automation

Database administrator interview question · 0–1 years

You are writing a small shell script that takes a backup on a Linux database server. What must it do besides running the backup command?

The strongest answer

Stop on the first error instead of carrying on, check the backup command’s exit code, write a timestamped log, remove old files by a retention rule, and exit non-zero so the scheduler knows it failed

Why it works

Right — a backup script that fails quietly is worse than no script, because everyone believes it is working.

What a good answer covers

Answers that fall short

Who gets asked this

More Automation questions