Jump to content

Welcome, Guest!

sportingchiefs

Members
  • Content count

    1
  • Joined

  • Last visited

Community Reputation

0 Neutral

About sportingchiefs

  • Rank
    Newbie

Profile Information

  • Location
    Columbus, MS
  1. Crontab with Raspivid/ffmpeg

    Good morning all, I seem to be having some issues with crontab lately and since I don't know much (or really anything) about it I was hoping you all could give me some pointers and help me get this pi running correctly! OS: Raspbian (9 September release) (pup.sh is my shell script that I have saved as root to run my raspivid command and is saved in /home/pi/pup.sh) I created the pup.sh and accessed crontab as root with crontab -e after putting in sudo bash. I have set up the raspberry pi camera and am running it with raspivid off a tutorial that I followed (can't link it here since I can't access the site at work). The raspivid is working great and is streaming the video to my ustream account just like it is supposed to. I have set up the raspivid as a way to monitor our new puppy while at work. I don't want to leave the camera running all the time so I was trying to get it working with crontab so that it will start and stop when I want it to. I've decided to just reboot when I want the raspivid to stop because a reboot never hurts and I have had issues using "killall". Here's the code that I'm using in root crontab: 00 0,11,17 * * * /sbin/shutdown -r now 00 7,12 * * 1-5 /usr/bin/screen -d -m /home/pi/pup.sh Now I have ran the "screen -d -m /home/pi/pup.sh" command by itself and it worked. I was trying to update the crontab at lunch today and changing it to a few minutes ahead and then monitoring via "top". Sure enough at the specified minute raspivid would show up in the list of processes and then shortly disappeared from the list. Could the time in crontab and the time specified in the pup.sh (raspivid -t XXX) be throwing each other off? Here is what I found in "cat /var/log/syslog" Oct 15 11:25:01 raspberrypi /USR/SBIN/CRON[2236]: (root) CMD (/usr/bin/screen -d -m /home/pi/pup.sh) Oct 15 11:25:40 raspberrypi crontab[2252]: (root) BEGIN EDIT (root) Oct 15 11:26:01 raspberrypi crontab[2252]: (root) REPLACE (root) Oct 15 11:26:01 raspberrypi crontab[2252]: (root) END EDIT (root) Oct 15 11:26:01 raspberrypi /usr/sbin/cron[2079]: (root) RELOAD (crontabs/root) Oct 15 11:27:01 raspberrypi /USR/SBIN/CRON[2258]: (root) CMD (/usr/bin/screen -d -m /home/pi/pup.sh) Oct 15 11:28:27 raspberrypi crontab[2271]: (root) BEGIN EDIT (root) Oct 15 11:28:39 raspberrypi crontab[2271]: (root) REPLACE (root) Oct 15 11:28:39 raspberrypi crontab[2271]: (root) END EDIT (root) Oct 15 11:29:01 raspberrypi /usr/sbin/cron[2079]: (root) RELOAD (crontabs/root) Oct 15 11:29:01 raspberrypi /USR/SBIN/CRON[2277]: (root) CMD (/usr/bin/screen -d -m /home/pi/pup.sh) I hope you can help me figure this out, I've been working it for several weeks (and through several forums!) and am just getting more frustrated. I appreciate any help, advice, and information in advance! -Tyler

About Us

Bringing you the latest Raspberry Pi news, tutorials and user forum.

The Fruity Computer

×