Solved curl follow symbolic link path upload

Solved issue

don_dolarson

New Member
Joined
Jun 19, 2023
Messages
2
Reaction score
0
Credits
24
Hi to the Linux world.

Trying to set up ntfy push notifications on my motioneye cctv camera system running Debian Bullseye using curl.
Whenever a picture is taken from the web interface in motioneye, it gets saved to (in my case) ~/Camera/Camera_name/$Date/$Time.jpg followed by an updated "lastsnap.jpg" file in parent directory, which is a symbolic link to the last picture taken.

Now to the problem. Whenever I send a push notification through my ntfy config and want the last snapshot attached to it, the lastsnap.jpg 12B blank file is sent to the push server, not the actual 50-100KB picture. Can something be done about it?

Code:
:~/Camera/Camera_name $ ll
drwxr-xr-x 2 motion motion 4,0K 2023-06-19 18:48:08.123381030 +0200 2023-06-19/
lrwxrwxrwx 1 motion motion   23 2023-06-19 18:48:08.147381075 +0200 lastsnap.jpg -> 2023-06-19/18-48-08.jpg
Code:
:~/Camera/Camera_name/2023-06-19 $ ll
-rw-r--r-- 1 motion motion 65K 2023-06-19 18:48:08.139381060 +0200 18-48-08.jpg


Here's my ntfy config file. There's not so much documentation about attachments (linked above), and because I'm not running my own ntfy server and not using ntfy cli but curl, I've decided to create a thread here and ask for help. I'm not green but my linux and programming experiences are 3 months and can't find any solution to it online, and whenever I do, it always fails.

Code:
#!/bin/bash

curl \
-H "Title: Motion on CCTV detected" \
-H "Priority: max" \
-H "Tags: rotating_light,camera_flash" \
-T ~/Camera/Camera_name/lastsnap.jpg \
-H "Filename: lastsnap.jpg" \
-d "TestTestTest" \
ntfy.sh/my_topic
 
Last edited:



Members online


Top