Wednesday, October 29, 2025

AWS Data Lifecycle Manager (DLM) setup for automated EC2 backups

Step 1: Choose “Custom policy” (as shown)

Keep:

  • Custom policy → selected

  • Policy typeEBS snapshot policy
    Then click Next step 🟧

Step 2: Target Resource Type

  • Resource type: Select Volume

  • Target resource tags:
    Add the tag you used on your EC2 volume, for example:

    • Key: Backup

    • Value: Daily

Only the volumes with this tag will be backed up automatically.

Step 3: Configure Schedule

  • Schedule name: Daily-EC2-Backup (or Weekly if preferred)

  • Frequency: Every 24 hours (for daily) or Every 7 days (for weekly)

  • Start time: Choose off-peak (e.g., 02:00 UTC)

  • Retention type: “Count”

  • Retain: 7 snapshots (automatically delete older ones)

Enable these options:

  • Copy tags from source

  • Exclude boot volumes (optional — keep unchecked if you want full backups including OS)

Step 4: IAM Role

If this is your first lifecycle policy:

  • Choose “Create new role for this policy”
    AWS will auto-generate permissions for DLM to create/delete snapshots.

Step 5: Review and Create

  • Review your policy summary (target tag, schedule, retention, IAM role)

  • Click Create Policy

Verification

After 24 hours (or at next schedule), go to:
👉 EC2 → Snapshots
You’ll see entries like:

“Created by EC2 Lifecycle Policy: Daily-EC2-Backup”

That confirms your automation works.


Tuesday, October 28, 2025

Push your local project to your own GitHub account


Step 1 — Check current remote

Run this in your project folder:

git remote -v

You’ll probably see something like:

origin  https://github.com/username/reponame (fetch)
origin  https://github.com/username/reponame (push)

 Step 2 — Set the correct remote for the username
git remote set-url origin https://github.com/username/reponame.git
 
 Step 3 — Verify the change

Run again:

git remote -v

You should see:

origin  https://github.com/username/reponame (fetch)
origin  https://github.com/username/reponame (push)
Step 4 — Set your identity (you already did this, but just to confirm)
git config user.name "username"
git config user.email "email@gmail.com"

Step 5 — Push to GitHub

Now push the main branch:

git push -u origin main

If prompted for credentials:

  • Username:

  • Password: your GitHub Personal Access Token (PAT) (not your GitHub password)

👉 Create one here: https://github.com/settings/tokens

When creating the token:

  • Choose “Fine-grained personal access token”

  • Grant Repository → Read and write access

  • Copy and paste it when Git asks for your password.


Set up GIT Personal Access Token Steps

 Go to GitHub.com → Settings → Developer settings → Personal access tokens → tokens (classic)

Generate new token with repo permissions

Copy the token

paste it as password during git push -u origin main

valid for 30 days