The summary.
AUTOMATE WHAT YOU MUST DO UNDER PRESSURE
Deployment, backup, restore and environment setup — those are where mistakes are most costly, and an incident is exactly when they happen.
MAKE SCRIPTS STOP ON THE FIRST FAILURE
Otherwise a failed step is followed by steps assuming it succeeded.
Build in a reporting mode, bound how much one run may affect, and make it safe to run twice.
FOR SCHEDULED TASKS, USE FULL PATHS AND SET THE ENVIRONMENT
They inherit nothing. A script working by hand and failing when scheduled is almost always paths or environment.
Capture output and alert on failure, or a failing task fails silently for months.
Prevent two copies running at once — a slow task overlaps itself.
AUTOMATE THE BACKUP, NOT THE RESTORE
But automate a restore into a separate environment, regularly, to prove the backup works.
Alert on a backup that is smaller than expected. One that completes and captures nothing is the worst kind.
REBUILD AN ENVIRONMENT FROM NOTHING, PERIODICALLY
The process decays, and you discover that only when you need it.
GIVE AUTOMATION ITS OWN SCOPED CREDENTIALS
Never a person's, and never broader than the task requires.
DECOMMISSION AUTOMATION NOBODY RELIES ON
It still runs, and it still has access.