andreafabrizi / Dropbox-Uploader

Dropbox Uploader is a BASH script which can be used to upload, download, list or delete files from Dropbox, an online file sharing, synchronization and backup service.
https://www.andreafabrizi.it/2016/01/01/Dropbox-Uploader/
GNU General Public License v3.0
6.57k stars 1.08k forks source link

Raspbian motion error #499

Open f43g opened 4 years ago

f43g commented 4 years ago

Hi!

i'm trying to use your script with raspbian and motion.

All works good but i have some problems with on_movie_end. At the end of the motion the video created should be uploaded on my dropbox account. This is the command:

on_movie_end /home/pi/motion/drop/dropupl.sh

This is the content of the script:

#!/bin/bash

echo "start upload" >> /home/pi/motion/drop/log.txt
sudo -u pi /home/pi/motion/drop/dropbox_uploader.sh upload /home/pi/motion/detected/02-25042020212043.mp4 test7.mp4 >> /home/pi/motion/drop/log.txt 2>&1
echo "end upload" >> /home/pi/motion/drop/log.txt

and this the content of the log file

start upload

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.

sudo: no tty present and no askpass program specified
end upload

from the command line /home/pi/motion/drop/dropupl.sh works, uploads the video on dropbox and it writes on the log file.

But when a motion is detected it writes on the log file but it 'skip' the line with the command and it doesn't upload the video on dropbox.

Can you help me?

telemaxx commented 4 years ago

for me it looks as "sudo" tries to ask for a password, but has no console. i run motion as user "pi" and did not use sudo. you can set the path of the Dropboxuploader.sh configuration via -f option