Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FR: Delete Interval Snapshots Automatically #1330

Closed
akeslo opened this issue Aug 23, 2024 · 4 comments
Closed

FR: Delete Interval Snapshots Automatically #1330

akeslo opened this issue Aug 23, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@akeslo
Copy link

akeslo commented Aug 23, 2024

Describe the bug

What is the current behavior of interval snapshots? It looks like the snapshots will continue to write until the directory is out of space. Does it overwrite older snapshots when this happens? Is it possible to limit snapshots to the last 7 days, last 30 days or w.e?

My docker host ran out of space and all images went down as a result.

Thanks!

Affected Bridge Version

Latest

Bridge type

Docker Run/Compose

Affected Camera(s)

No response

Affected Camera Firmware

No response

docker-compose or config (if applicable)

No response

@akeslo akeslo added the bug Something isn't working label Aug 23, 2024
@mrlt8
Copy link
Owner

mrlt8 commented Aug 25, 2024

The default behavior of the snapshots is to just overwrite the existing snapshot. Can you post any relevant parts of your docker-compose.yml?

@akeslo
Copy link
Author

akeslo commented Aug 26, 2024

The default behavior of the snapshots is to just overwrite the existing snapshot. Can you post any relevant parts of your docker-compose.yml?

Absolutely, docker-compose.yml below:

version: '2.4'
services:
  wyze-bridge:
    container_name: wyze-bridge
    restart: unless-stopped
    image: mrlt8/wyze-bridge:dev
    ports:
      - 1935:1935   # RTMP
      - 8554:8554   # RTSP
      - 8888:8888   # HLS
      - 8889:8889   # WebRTC
      - 8189:8189/udp  # WebRTC/ICE
      - 5000:5000   # WEB-UI
    volumes:
      - type: bind
        source: /DATA/AppData/wyzebridge/snapshots
        target: /img
    environment:
      - WB_IP=192.168.3.101
      - ENABLE_AUDIO=True
      - QUALITY_BACK_LEFT_FLOOD_LIGHT=SD60
      - QUALITY_BACK_RIGHT_FLOOD_LIGHT=SD60
      - QUALITY_FRONT_LEFT_FLOOD_LIGHT=SD60
      - QUALITY_FRONT_RIGHT_FLOOD_LIGHT=SD60
      - ROTATE_CAM_KESCAM=1
      - SNAPSHOT=RTSP
      - SNAPSHOT_FORMAT={cam_name}/%Y-%m-%d/%H-%M-%S.jpg
    logging:
      driver: json-file
      options:
       max-size: "10m"

mrlt8 added a commit that referenced this issue Aug 26, 2024
@mrlt8
Copy link
Owner

mrlt8 commented Aug 26, 2024

Thanks, I made some changes in the dev branch, so you should be able to use SNAPSHOT_KEEP. Here are some examples:

# Keep snapshots for 3 minutes:
- SNAPSHOT_KEEP=180
- SNAPSHOT_KEEP=180s
- SNAPSHOT_KEEP=3m

# keep snapshots for 3 days:
- SNAPSHOT_KEEP=72h
- SNAPSHOT_KEEP=3d

# keep snapshots for 2 weeks:
- SNAPSHOT_KEEP=14d
- SNAPSHOT_KEEP=2w

@akeslo
Copy link
Author

akeslo commented Aug 26, 2024

@mrlt8 thanks so much! Just gave it a try and looks to be working as expected!

@akeslo akeslo closed this as completed Aug 26, 2024
mrlt8 added a commit that referenced this issue Sep 13, 2024
* Delete old snapshots #1330

* purge old snapshots when taking any snapshot

* Tweak RTMP and add RestreamIO #1333

* Increase MTX_WRITEQUEUESIZE for higher bitrates

* Fix typo

* restart stream on RTMP fail #1333

* Fix restore user data on restart #1334

* Use email from wyze api response directly

* Bump previous build to 2.9.12

* Update config.yml

* bump previous build

* Changelog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants