{"id":24521793,"url":"https://github.com/timintech/scrape-together-old-photos","last_synced_at":"2025-03-15T12:43:29.958Z","repository":{"id":195752589,"uuid":"693580120","full_name":"TimInTech/Scrape-together-old-photos","owner":"TimInTech","description":"A script to find and recover old photos from external storage devices.  ","archived":false,"fork":false,"pushed_at":"2025-02-26T03:20:09.000Z","size":9,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-26T04:19:01.102Z","etag":null,"topics":["backup-automation","data-recovery","filesystem-scanning","hard-drive-scanner","lost-files","usb-recovery"],"latest_commit_sha":null,"homepage":"https://TimInTech.github.io/Scrape-together-old-photos  ","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TimInTech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-09-19T10:00:05.000Z","updated_at":"2025-02-26T03:26:00.000Z","dependencies_parsed_at":"2023-09-19T13:12:00.859Z","dependency_job_id":null,"html_url":"https://github.com/TimInTech/Scrape-together-old-photos","commit_stats":null,"previous_names":["gummiflip/scrape-together-old-photos","timintech/scrape-together-old-photos"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimInTech%2FScrape-together-old-photos","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimInTech%2FScrape-together-old-photos/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimInTech%2FScrape-together-old-photos/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimInTech%2FScrape-together-old-photos/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TimInTech","download_url":"https://codeload.github.com/TimInTech/Scrape-together-old-photos/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243732252,"owners_count":20338831,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["backup-automation","data-recovery","filesystem-scanning","hard-drive-scanner","lost-files","usb-recovery"],"created_at":"2025-01-22T03:13:02.930Z","updated_at":"2025-03-15T12:43:29.952Z","avatar_url":"https://github.com/TimInTech.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\n# 📸 **Scrape-together-old-photos - Digital Time Capsule**\n\n## **🕰️ Welcome to the Time Capsule Community!**\n\nWe are on a mission to **rediscover and preserve old memories** by searching forgotten **hard drives, USB devices, and folders** for lost photos.\n\nThis repository provides a **Bash script** that automatically scans your **external storage devices**, extracts images, and organizes them **by year and month** based on metadata.\n\n---\n\n## **🛠️ Features**\n✅ **Scans external drives \u0026 USB devices** for old photos\n✅ **Detects images** (`.jpg`, `.png`, `.gif`, `.tiff`, `.bmp`)\n✅ **Sorts images by year \u0026 month** based on file metadata\n✅ **Creates a log file** for tracking scanned files\n\n---\n\n# 🚀 **Script: `scrape_photos.sh`**\n\n### **📂 How It Works:**\n- The script **searches all mounted drives** for image files.\n- It **copies** them into a **central backup folder** sorted by **year and month**.\n- A **log file** keeps track of all extracted images.\n\n---\n\n### **📜 Bash Script (`scrape_photos.sh`)**\n\nSave the following script as `scrape_photos.sh`, **make it executable**, and run it.\n\n```bash\n#!/bin/bash\n\n# Scrape-together-old-photos - Find and recover old photos from external storage\n# Author: TimInTech | Version: 1.0\n# Description: This script scans connected hard drives \u0026 USB devices for old photos and copies them to a central \"Recovered\" folder.\n\n### 🔍 STEP 1: Define Directories ###\nBACKUP_DIR=\"$HOME/Recovered\"\nLOG_FILE=\"$BACKUP_DIR/scrape_log.txt\"\n\n# Create backup folder if it doesn't exist\nmkdir -p \"$BACKUP_DIR\"\n\n### 📂 STEP 2: Find All External Drives ###\necho \"[INFO] Searching for connected hard drives \u0026 USB devices...\" | tee -a \"$LOG_FILE\"\nMOUNT_POINTS=$(lsblk -o MOUNTPOINT,TYPE | grep part | awk '{print $1}')\n\nif [ -z \"$MOUNT_POINTS\" ]; then\n    echo \"[WARNING] No external drives found!\" | tee -a \"$LOG_FILE\"\n    exit 1\nfi\n\n### 🖼️ STEP 3: Search for Photos \u0026 Copy Them ###\necho \"[INFO] Scanning the following drives: $MOUNT_POINTS\" | tee -a \"$LOG_FILE\"\n\nfor DRIVE in $MOUNT_POINTS; do\n    echo \"[INFO] Scanning $DRIVE for image files...\" | tee -a \"$LOG_FILE\"\n\n    find \"$DRIVE\" -type f \\( -iname \"*.jpg\" -o -iname \"*.png\" -o -iname \"*.gif\" -o -iname \"*.tiff\" -o -iname \"*.bmp\" \\) | while read -r FILE; do\n        # Extract metadata (year and month)\n        YEAR=$(stat -c %y \"$FILE\" | cut -d'-' -f1)\n        MONTH=$(stat -c %y \"$FILE\" | cut -d'-' -f2)\n\n        # Create target folder\n        TARGET_DIR=\"$BACKUP_DIR/$YEAR/$MONTH\"\n        mkdir -p \"$TARGET_DIR\"\n\n        # Copy file\n        cp -n \"$FILE\" \"$TARGET_DIR\"\n        echo \"[OK] Saved: $FILE → $TARGET_DIR\" | tee -a \"$LOG_FILE\"\n    done\ndone\n\necho \"[DONE] All images have been saved to: $BACKUP_DIR\" | tee -a \"$LOG_FILE\"\n```\n\n---\n\n## **📖 Installation \u0026 Usage**\n\n### 🔹 **1. Download the Script**\n```bash\ngit clone https://github.com/TimInTech/Scrape-together-old-photos.git\ncd Scrape-together-old-photos\nchmod +x scrape_photos.sh\n```\n\n### 🔹 **2. Run the Script**\n```bash\n./scrape_photos.sh\n```\n\n### 🔹 **3. View the Results**\n- 📂 Images are stored in: `~/Recovered/Year/Month/`\n- 📄 Log file: `scrape_log.txt`\n\n---\n\n## 🔧 **Additional Commands**\n\n### 📌 **View Logs**\nCheck the scan log to see which files were processed:\n```bash\ncat ~/Recovered/scrape_log.txt\n```\n\n### 📌 **Delete Duplicate Files**\nIf you want to remove duplicate images, use `fdupes`:\n```bash\nsudo apt install fdupes\nfdupes -rd ~/Recovered\n```\n\n### 📌 **Manually List External Drives**\n```bash\nlsblk | grep -i usb\n```\n\n### 📌 **Delete the Backup Folder (If Needed)**\n```bash\nrm -rf ~/Recovered\n```\n\n---\n\n## **🤝 Contribute**\n🔹 Found an issue? **Report it!**\n🔹 Want to improve the script? **Submit a Pull Request!**\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimintech%2Fscrape-together-old-photos","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimintech%2Fscrape-together-old-photos","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimintech%2Fscrape-together-old-photos/lists"}