Underc0de

Foros Generales => Dudas y pedidos generales => Mensaje iniciado por: jalucerol en Abril 07, 2014, 10:05:04 PM

Título: Problema con cron
Publicado por: jalucerol en Abril 07, 2014, 10:05:04 PM
Hola, quizas  no sea el lugar adecuado para postear, si es asi y deben mover el post no hay problema.

Bueno, la cuestion es como sigue:

1.- tengo una camara IP, de la cual quiero grabar video a intervalos regulares, longitud del video 60 segundos, cada 5 minutos.
2.- adapte un script para capturar video:

#!/bin/bash

NEW_NAME="cam1-"$(date +%d)"."$(date +%m)"."$(date +%y)"-hour"$(date +%H)"-"$(date +%M)".avi"
nohup /usr/bin/curl -s -m 60 -o /media/Flash/$NEW_NAME --user *****:***** http://192.168.1.3:8000/videostream.cgi?user=*****&pwd=*****&resolution=8


este se llama record.sh
3.- lo hice ejecutable
4.- lo registre en crontab

# Edit this file to introduce tasks to be run by cron.
#
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
#
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use '*' in these fields (for 'any').#
# Notice that tasks will be started based on the cron's system
# daemon's notion of time and timezones.
#
# Output of the crontab jobs (including errors) is sent through
# email to the user the crontab file belongs to (unless redirected).
#
# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
#
# For more information see the manual pages of crontab(5) and cron(8)
#
# m h  dom mon dow   command
5/5 * * * * root /home/juan/record.sh


El tema es que graba video a los 5 minutos de cada hora... y nunca mas...

cual puede ser el furcio????
Título: Re:problema con cron
Publicado por: jalucerol en Abril 08, 2014, 09:06:16 PM
bue, ya le saque la ficha. Resulta que por terminal tire este comando:

sudo crontab -u  root -e


eso modificaba una lista de tareas, pero no se por que diablos ubuntu no la ejecuta. Asi que leyendo leyendo me entere que era mejor que meter ese comando, este otro:

sudo nano /etc/crontab

Y con eso voilâ!!!! anduvo de pelicula.

Espero que les sirva a alguien.