DEV Community

Wycliffe A. Onyango
Wycliffe A. Onyango

Posted on

100 Days of DevOps: Day 10

Automated Backup Solution

I have successfully completed the project to automate the backup of xFusionCorp Industries' static website. The new solution, using a bash script, ensures that the company's website data is securely backed up, improving data integrity and operational efficiency.

Implementation Details

Here is a breakdown of the steps I took to accomplish this task:

  1. Script Creation: I created the media_backup.sh bash script and placed it in the /scripts directory on App Server 1. This script is now responsible for:

    • Zipping Files: It compresses the /var/www/html/media directory into a zip archive named xfusioncorp_media.zip.
    • Local Storage: This archive is saved to the /backup directory for temporary local storage.
    • Remote Transfer: The script then securely transfers the backup file to the Nautilus Backup Server.
  2. Passwordless SSH: To ensure the backup process runs automatically without any manual intervention, I configured passwordless SSH. I generated an SSH key pair on App Server 1 and copied the public key to the clint user's authorized keys on the Nautilus Backup Server. This allows the script to use scp to copy the file without prompting for a password.

  3. Permissions: I made the script executable using the chmod u+x command, which allows the server user to run it.

This automated solution now provides a reliable and efficient way to manage website backups, contributing to the overall stability and security of xFusionCorp's web presence.

Top comments (0)