Answer the question
In order to leave comments, you need to log in
How to give permission to run a script from another user?
Hello dear!
Motion is installed on the home server - it writes video from cameras based on motion. The files are added to a special nextcloud folder, which should be synchronized immediately after the recording is completed, and for this it needs to be given a command to scan the folder for new files on behalf of the owncloud apache user. To do this, the motion config specifies: on_event_end /home/seventh/rescan_motion.sh
And in this script:
#!/bin/sh
sudo -u owncloud php /var/www/nextcloud/occ files:scan -p /seventh/files/motion
*** SECURITY information for server ***
server : Mar 21 15:29:27 : motion : user NOT in sudoers ; TTY=unknown ; PWD=/ ; USER=owncloud ; COMMAND=/usr/bin/php /var/www/nextcloud/occ files:scan -p /seventh/files/motion
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question