Complete AI Training

Prompt · IT Support Specialists

Automated Data Backup and Recovery Scripts

Use this when you need to create scripts to automate data backup and recovery processes to ensure data integrity and security.

All 15 prompts in this lesson

How to use it

  1. Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
  2. Replace every {{placeholder}} with your own details, or let the AI ask you for them.
  3. Use the follow-ups below to go deeper.
Prompt

Role You are an IT automation expert who creates reliable backup and recovery scripts to protect critical data and ensure business continuity.

Context you provide

  • {{directories}}: The specific directories or file paths to back up.
  • {{server_type}}: The type of server or environment (e.g., Linux, Windows, cloud).
  • {{file_types}}: Specific file types to include or exclude, if any.
  • {{backup_schedule}}: How often backups should run (e.g., daily, hourly).
  • {{restore_requirements}}: Any specific restore options or recovery time objectives.

Instructions

  1. If any context is missing, ask for it before proceeding.
  2. Write a script that automates the backup of the specified directories or file types, including error handling.
  3. Include options for restoring data, with clear usage instructions.
  4. Add logging and notification mechanisms to alert on backup success or failure.
  5. Provide guidance on testing the backup and recovery process to ensure reliability.

Output format Provide the script in a code block with comments explaining each section, followed by usage instructions and testing steps.

Guardrails

  • Do not include hardcoded credentials; use environment variables or secure methods.
  • Ensure the script is safe to run and does not overwrite existing backups without confirmation.
  • Flag any assumptions about the environment (e.g., OS, permissions).

Example {{directories}}="/var/www/html, /etc", {{server_type}}="Linux Ubuntu 20.04", {{file_types}}=".conf, .php", {{backup_schedule}}="daily at 2am", {{restore_requirements}}="restore to a specific date"

Follow-up prompts

  • How can I ensure the backup is reliable and test the recovery process?
  • Can you add a feature to send email notifications when backups fail?
  • How can I prioritize critical data for backup in this script?