how i can do a crontab as user on raspbian?

♀尐吖头ヾ 提交于 2019-12-07 21:52:52

问题


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

回答1:


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.



来源:https://stackoverflow.com/questions/14787350/how-i-can-do-a-crontab-as-user-on-raspbian

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!