Skip to content

hillawi/media-files-backup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

94 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Media Files Backup (MFB)

Backup your pictures and videos files in an easy and fast way.

General information

The media files (images and videos) should respect the following naming convention:

  • [IMG|VID]_YYYYMMDD[X].[jpg|mp4]

Where:

  • YYYY the year

  • DD the month

  • MM the day

  • X any other characters

This is usually the case for digital cameras and phones.

Installation and Getting Started

Configuration

Run the provided script to set up the directories structure.

MFB_HOME=/opt/mfb ./backend/bin/generate_config.sh

Those directories will contain:

  • The devices configuration file (devices.json)

  • The git repository used by mfb-config (configuration of the rest service)

  • The mount points for the source and target devices

Define the mount points

Example:

Source device

mount -s /media/a/b/c/DCIM $MFB_HOME/device/myphone

Target device

moutn -s /media/x/y/z/My_Phone_Media_Files $MFB_HOME/device/external_ssd_1TB

Note that, myphone and external_ssd_1TB are defined in $MFB_HOME/conf/devices.json as devices ID’s.

Launch using Docker

docker-compose up -d
services:
  mfb-config:
    container_name: mfb-config
    privileged: true
    hostname: mfb-config
    image: aabdeen/mfb-config:0.0.1-SNAPSHOT
    expose:
      - "8787"
    ports:
      - "8787:8787"
    environment:
      SPRING_PROFILES_ACTIVE: basic,offline
      MFB_CONF_DIR: /opt/mfb/conf
    volumes:
      - /opt/mfb/conf:/opt/mfb/conf
    networks:
      - mfb-network
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:8787/mfb-rest/docker"]
      interval: 1m
      timeout: 10s
      retries: 3
      start_period: 5s
  mfb-rest:
    container_name: mfb-rest
    privileged: true
    hostname: mfb-rest
    image: aabdeen/mfb-rest:0.0.1-SNAPSHOT
    expose:
      - "8387"
    ports:
      - "8387:8387"
    environment:
      SPRING_PROFILES_ACTIVE: docker
      MFB_HOME: /opt/mfb
      spring.config.import: "configserver:http://mfb-config:8787"
    volumes:
      - /opt/mfb:/opt/mfb
      - /media/ahmedhillawi:/media/ahmedhillawi
    networks:
      - mfb-network
    depends_on:
      - mfb-config
    restart: on-failure
  mfb-frontend:
    container_name: mfb-frontend
    image: aabdeen/mfb-frontend:0.0.1-SNAPSHOT
    build:
      context: frontend
      dockerfile: Dockerfile
    ports:
      - "8383:8383"
networks:
  mfb-network:
    name: mfb-network
    driver: bridge
    external: true