I am new to Unix, learning how to schedule a job. Starting with a simple command like
* * * * * echo 'hello'
on vim. However I do not get the standard output at the start of every minute, instead receiving a mail in /var/mail/john
. It goes as follows:
From john@MacBook-Pro-3.local Fri Mar 3 22:43:00 2023
Return-Path: <john@MacBook-Pro-3.local>
X-Original-To: john
Delivered-To: john@MacBook-Pro-3.local
Received: by MacBook-Pro-3.local (Postfix, from userid 503)
id 5CD99869153; Fri, 3 Mar 2023 22:43:00 -0800 (PST)
From: john@MacBook-Pro-3.local (Cron Daemon)
To: john@MacBook-Pro-3.local
Subject: Cron <john@MacBook-Pro-3> echo 'hello hello'
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=john>
X-Cron-Env: <USER=john>
Message-Id: <20230304064300.5CD99869153@MacBook-Pro-3.local>
Date: Fri, 3 Mar 2023 22:43:00 -0800 (PST)
hello hello
MacBook-Pro-3:~ john$
You have new mail in /var/mail/john
MacBook-Pro-3:~ john$
Can anyone throw some light on it, so that the cron job can be executed as intended?
hello
in all of them? Or in one? which one? – Kamil Maciorowski Mar 04 '23 at 07:24*/3 * * * * date >> Test.cron
and watching the output in another terminal usingtail -F Test.cron
. – Paul_Pedant Mar 04 '23 at 09:56