Cronab every minute on raspberries

I try to run a shell script to run every minute on raspberry pi using crontab, for example:

 crontab -e

and then:

 * * * * * /home/pi/job.sh

where is the task:

 #!/bin/sh
 echo "hello"

I expect the message to be sure that the script is running, but nothing is happening. Is there any special trick to run code on raspberry pi every time?

+4
source share
3 answers

The output from a cron job is sent by email to the cron job owner by default.

I assume your script is working fine and you have a bunch of emails in the queue, or if mail is not configured, log messages indicating that cron cannot send emails.

Try this instead of a script:

#!/bin/sh
date >>/tmp/crontest.txt

/tmp/crontest.txt , , .

+4
#min hour day month weekday command
*/1   *    *    *    *     <your command>

+3

:

logger -t MyTag "MyTask: Completed successfully."

in a script, if you prefer to leave the cron entry turned off and still see some data from your script in the system logs.

+1
source

All Articles