Antoine Trappeur
Antoine Trappeur

Reputation: 87

how i can do a crontab as user on raspbian?

I'm on a raspberry pi, with rasbpian ! I'm trying to install a new crontab for execute an basic script. This one will take a picture from webcam with vlc.

I want to do this every minute but i can't edit my crontab user (crontab -e), only the sudo crontab... Or vlc must do execute without root !

pi@raspberrypi ~ $ crontab -e
crontabs/pi/: fdopen: Permission denied

Every body know how i can do ?

This is my script :

#!/bin/bash

cvlc -I dummy v4l2:///dev/video0 --video-filter scene --no-audio --scene-path $

date > ~/webcam/date.txt

And this is my crontab for root, which not work :

* * * * * sh image.sh

Upvotes: 2

Views: 9883

Answers (1)

daviewales
daviewales

Reputation: 2699

I don't know why you're getting permission denied for crontab -e, but if you use sudo crontab -e -u pi, then you will be able to open the crontab for the pi user with sudo.

Incidentally, you probably need to specify a direct path for image.sh. Otherwise the script won't be able to find it.

Upvotes: 3

Related Questions