PhotopilotPhotopilot
SMB Sync

SMB Sync: from network drive to Photopilot

A small program that watches an SMB/Samba share (such as a StyleShoots machine) and automatically uploads photo folders as shoots and packshots.

  • Shoots

    Folders named S-<set number> (e.g. S-1234) are uploaded as a shoot for that set.

  • Packshots

    Every other folder is treated as an article: a scanned EAN/barcode or a public article number. Photos with back, side or label in the filename are linked as that view.

  • Flat mode

    For StyleShoots setups that drop every file loose into the folder: set FLAT_PACKSHOT=true. Loose photos are grouped by article identifier (the part before the first underscore) and synced as packshots.

  • Safe

    A folder is only synced after nothing has changed for 10 minutes. Unknown articles are skipped and retried later.

Installation on Windows Server

  1. Download and unpack

    Download windows-amd64.exe.gz above, unpack it and place smbsync.exe in its own folder, for example C:\Photopilot\smbsync\.

  2. Create a .env file in the same folder
    CUSTOMER=Bedrijfsnaam
    SMB_IP=192.168.1.10
    SMB_USERNAME=styleshootssharing
    SMB_PASSWORD=wachtwoord
    SMB_MOUNT=StyleshootsDrive
    START_DIR=sync
    API_TOKEN=jouw-api-token
    API_URL=https://app.photopilot.ai/api
    LOG_LEVEL=info
    TZ=Europe/Amsterdam
    
    # Optioneel: StyleShoots-modus waarbij alle bestanden los in START_DIR staan
    # (geen submap per artikel). Losse foto's worden gegroepeerd op artikel-
    # identifier (het deel voor de eerste underscore) en als packshots gesynct.
    FLAT_PACKSHOT=false
  3. Point it to your Samba/SMB share

    SMB_IP is the IP address of the machine hosting the share (e.g. the StyleShoots or your NAS). SMB_MOUNT is the name of the share itself and START_DIR the folder within the share that is synced. The account needs read and write access: processed folders are cleaned up after upload.

  4. Start automatically with Windows

    Open Task Scheduler, create a task that starts smbsync.exe when the computer boots and set 'Start in' to the folder containing the .env. Choose 'Run whether user is logged on or not'.

  5. Check

    Create a test folder named after an EAN code on the share, put a photo in it and wait ±10 minutes. The photo appears with the article in Photopilot and the folder is cleaned up. Errors automatically reach us via Sentry.