N
N
nekto8122018-07-22 23:29:48
Raspberry Pi
nekto812, 2018-07-22 23:29:48

Edit a line to execute a file on a schedule?

This line:
*/1 8-21 * * * sudo fswebcam -c /home/pi/.cam.conf
in the file:

crontab -e

Launches a snapshot from the camera to send to the cloud drive.
Every minute. Those. The unit at the beginning is one minute. The question is how to make it run every 10 seconds? Fractions do not work visited!

Answer the question

In order to leave comments, you need to log in

3 answer(s)
I
Igor, 2018-08-02
@nekto812

As you have already written above, the minimum period of time is crona minute. There are several options

  • write a script that will run a command and sleep for 10 seconds in a loop 5 times and run this script every minute from cron
  • use watch command
  • Use the timer in SystemD, for this you will need to create 2 files, one for the unit itself and the second for the timer

S
Sergey, 2018-07-22
@ferocactus

Unfortunately, crontab does not allow you to work with time intervals of less than one minute.

R
Radjah, 2018-09-26
@Radjah

If the system has systemd, then you can use systemd.timer There are seconds .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question