Let's say you want to host domains first.com and second.com.
Create folders for their files:
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <link href="http://fonts.googleapis.com/icon?family=Material+Icons" rel= | |
| "stylesheet"> | |
| <link href= | |
| "https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.7/css/materialize.min.css" | |
| rel="stylesheet"> | |
| <meta content="width=device-width, initial-scale=1.0" name="viewport"> | |
| <title>Discord Webhook Sender</title> |
| <!doctype html> | |
| <title>Site Maintenance</title> | |
| <style> | |
| body { text-align: center; padding: 150px; } | |
| h1 { font-size: 50px; } | |
| body { font: 20px Helvetica, sans-serif; color: #333; } | |
| article { display: block; text-align: left; width: 650px; margin: 0 auto; } | |
| a { color: #dc8100; text-decoration: none; } | |
| a:hover { color: #333; text-decoration: none; } | |
| </style> |
| #!/bin/bash | |
| # Get postman app | |
| wget https://dl.pstmn.io/download/latest/linux64 -O postman.tar.gz | |
| sudo tar -xzf postman.tar.gz -C /opt | |
| sudo ln -s /opt/Postman/Postman /usr/bin/postman | |
| #Create a Desktop Entry | |
| cat > ~/.local/share/applications/postman.desktop <<EOL | |
| [Desktop Entry] | |
| Encoding=UTF-8 |
| #!/bin/sh | |
| set -e | |
| HOST=localhost | |
| DB=test-entd-products | |
| COL=asimproducts | |
| S3PATH="s3://mongodb-backups-test1-entd/$DB/$COL/" | |
| S3BACKUP=$S3PATH`date +"%Y%m%d_%H%M%S"`.dump.gz | |
| S3LATEST=$S3PATH"latest".dump.gz | |
| /usr/bin/aws s3 mb $S3PATH |
| #!/bin/sh | |
| # Make sure to: | |
| # 1) Name this file `backup.sh` and place it in /home/ubuntu | |
| # 2) Run sudo apt-get install awscli to install the AWSCLI | |
| # 3) Run aws configure (enter s3-authorized IAM user and specify region) | |
| # 4) Fill in DB host + name | |
| # 5) Create S3 bucket for the backups and fill it in below (set a lifecycle rule to expire files older than X days in the bucket) | |
| # 6) Run chmod +x backup.sh | |
| # 7) Test it out via ./backup.sh |