Secure your project data with a 3-2-1 backup strategy script in 10 minutes

Beginner
10 min
English

Generate a reliable, automated backup script for your database and files without spending hours reading documentation.

Steps

  1. Open ChatGPT or Claude in your browser.
  2. Copy the prompt template below and paste it into the chat.
  3. Replace the {database_type}, {file_directory}, and {cloud_provider} variables with your actual project details.
  4. Press Enter and review the generated backup script and cron job instructions.
  5. Ask the AI to explain any specific line if you are unsure what it does (e.g., 'Explain line 4').
  6. Copy the final script into a file named backup.sh on your server.
  7. Run the script manually once to verify it creates a backup and uploads it successfully.
  8. Set up the provided cron job to automate the backup daily.

Prompts to Use

Act as a senior DevOps engineer. I need to implement a 3-2-1 backup strategy for a {database_type} database and a local directory at {file_directory}. Write a bash script that: 1. Dumps the database and archives the directory. 2. Compresses them into a single timestamped file. 3. Uploads the compressed file to {cloud_provider} using their CLI. 4. Deletes local backups older than 7 days. Also, provide the exact cron job syntax to run this script daily at 2 AM. Include brief comments in the script explaining each step.

Tools Used

Some tool links may earn AiA a commission — never affecting rankings.

Real results from people who did this

Be the first to share what this changed for you.

Sign in after running a recipe to submit your impact story.

Sign in to share what this changed for you — help the next person learn from your win.