我已将 cron 任务设置为每 15 分钟执行一次。我的 cron 任务是*/15 * * * * /usr/bin/python3.6 /home/ubuntu/main.py >> /tmp/file
上述作业将每 15 分钟执行一次并发送电子邮件。但我一次收到两封电子邮件。所以我检查了日志。我发现它一次执行了两次。在日志中,您可以看到突出显示的作业在 05:17 执行,但有一个作业早在 05:15 执行,时间间隔为 2 分钟。但我设置的时间间隔是 15 分钟。那么我能找到背后的原因吗?
这是我的日志文件
Oct 1 23:15:51 escnn CRON[10086]: (CRON) info (No MTA installed, discarding output)
Oct 1 23:17:01 escnn CRON[10164]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
Oct 1 23:30:01 escnn CRON[10240]: (ubuntu) CMD (/usr/bin/python3.6 /home/ubuntu/Deploy/LSTM_Attention_IMDB_New_open.py >> /tmp/file)
Oct 1 23:30:54 escnn CRON[10239]: (CRON) info (No MTA installed, discarding output)
Oct 1 23:45:01 escnn CRON[10318]: (ubuntu) CMD (/usr/bin/python3.6 /home/ubuntu/Deploy/LSTM_Attention_IMDB_New_open.py >> /tmp/file)
Oct 1 23:45:54 escnn CRON[10317]: (CRON) info (No MTA installed, discarding output)
Oct 2 00:00:01 escnn CRON[10396]: (ubuntu) CMD (/usr/bin/python3.6 /home/ubuntu/Deploy/LSTM_Attention_IMDB_New_open.py >> /tmp/file)
Oct 2 00:00:54 escnn CRON[10395]: (CRON) info (No MTA installed, discarding output)
Oct 2 00:15:01 escnn CRON[10474]: (ubuntu) CMD (/usr/bin/python3.6 /home/ubuntu/Deploy/LSTM_Attention_IMDB_New_open.py >> /tmp/file)
Oct 2 00:15:53 escnn CRON[10473]: (CRON) info (No MTA installed, discarding output)
Oct 2 00:17:01 escnn CRON[10552]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
Oct 2 00:30:01 escnn CRON[10556]: (ubuntu) CMD (/usr/bin/python3.6 /home/ubuntu/Deploy/LSTM_Attention_IMDB_New_open.py >> /tmp/file)
Oct 2 00:31:06 escnn CRON[10555]: (CRON) info (No MTA installed, discarding output)
Oct 2 00:45:02 escnn CRON[10634]: (ubuntu) CMD (/usr/bin/python3.6 /home/ubuntu/Deploy/LSTM_Attention_IMDB_New_open.py >> /tmp/file)
Oct 2 00:46:03 escnn CRON[10633]: (CRON) info (No MTA installed, discarding output)
Oct 2 01:00:01 escnn CRON[10702]: (ubuntu) CMD (/usr/bin/python3.6 /home/ubuntu/Deploy/LSTM_Attention_IMDB_New_open.py >> /tmp/file)
Oct 2 01:00:55 escnn CRON[10701]: (CRON) info (No MTA installed, discarding output)
Oct 2 01:15:01 escnn CRON[10781]: (ubuntu) CMD (/usr/bin/python3.6 /home/ubuntu/Deploy/LSTM_Attention_IMDB_New_open.py >> /tmp/file)
Oct 2 01:15:55 escnn CRON[10780]: (CRON) info (No MTA installed, discarding output)
Oct 2 01:17:01 escnn CRON[10858]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
Oct 2 01:30:01 escnn CRON[10862]: (ubuntu) CMD (/usr/bin/python3.6 /home/ubuntu/Deploy/LSTM_Attention_IMDB_New_open.py >> /tmp/file)
Oct 2 01:31:08 escnn CRON[10861]: (CRON) info (No MTA installed, discarding output)
Oct 2 01:45:01 escnn CRON[10944]: (ubuntu) CMD (/usr/bin/python3.6 /home/ubuntu/Deploy/LSTM_Attention_IMDB_New_open.py >> /tmp/file)
Oct 2 01:46:03 escnn CRON[10943]: (CRON) info (No MTA installed, discarding output)
Oct 2 02:00:01 escnn CRON[11022]: (ubuntu) CMD (/usr/bin/python3.6 /home/ubuntu/Deploy/LSTM_Attention_IMDB_New_open.py >> /tmp/file)
Oct 2 02:00:51 escnn CRON[11021]: (CRON) info (No MTA installed, discarding output)
Oct 2 02:15:01 escnn CRON[11101]: (ubuntu) CMD (/usr/bin/python3.6 /home/ubuntu/Deploy/LSTM_Attention_IMDB_New_open.py >> /tmp/file)
Oct 2 02:16:11 escnn CRON[11100]: (CRON) info (No MTA installed, discarding output)
Oct 2 02:17:01 escnn CRON[11179]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
Oct 2 02:30:01 escnn CRON[11183]: (ubuntu) CMD (/usr/bin/python3.6 /home/ubuntu/Deploy/LSTM_Attention_IMDB_New_open.py >> /tmp/file)
Oct 2 02:31:07 escnn CRON[11182]: (CRON) info (No MTA installed, discarding output)
Oct 2 02:45:01 escnn CRON[11262]: (ubuntu) CMD (/usr/bin/python3.6 /home/ubuntu/Deploy/LSTM_Attention_IMDB_New_open.py >> /tmp/file)
Oct 2 02:45:56 escnn CRON[11261]: (CRON) info (No MTA installed, discarding output)
Oct 2 03:00:01 escnn CRON[11341]: (ubuntu) CMD (/usr/bin/python3.6 /home/ubuntu/Deploy/LSTM_Attention_IMDB_New_open.py >> /tmp/file)
Oct 2 03:00:56 escnn CRON[11340]: (CRON) info (No MTA installed, discarding output)
Oct 2 03:15:01 escnn CRON[11419]: (ubuntu) CMD (/usr/bin/python3.6 /home/ubuntu/Deploy/LSTM_Attention_IMDB_New_open.py >> /tmp/file)
Oct 2 03:15:51 escnn CRON[11418]: (CRON) info (No MTA installed, discarding output)
Oct 2 03:17:01 escnn CRON[11485]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
Oct 2 03:30:01 escnn CRON[11489]: (ubuntu) CMD (/usr/bin/python3.6 /home/ubuntu/Deploy/LSTM_Attention_IMDB_New_open.py >> /tmp/file)
Oct 2 03:30:54 escnn CRON[11488]: (CRON) info (No MTA installed, discarding output)
Oct 2 03:45:01 escnn CRON[11567]: (ubuntu) CMD (/usr/bin/python3.6 /home/ubuntu/Deploy/LSTM_Attention_IMDB_New_open.py >> /tmp/file)
Oct 2 03:45:52 escnn CRON[11566]: (CRON) info (No MTA installed, discarding output)
Oct 2 04:00:01 escnn CRON[11645]: (ubuntu) CMD (/usr/bin/python3.6 /home/ubuntu/Deploy/LSTM_Attention_IMDB_New_open.py >> /tmp/file)
Oct 2 04:01:12 escnn CRON[11644]: (CRON) info (No MTA installed, discarding output)
Oct 2 04:15:01 escnn CRON[11723]: (ubuntu) CMD (/usr/bin/python3.6 /home/ubuntu/Deploy/LSTM_Attention_IMDB_New_open.py >> /tmp/file)
Oct 2 04:16:13 escnn CRON[11722]: (CRON) info (No MTA installed, discarding output)
Oct 2 04:17:01 escnn CRON[11801]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
Oct 2 04:30:01 escnn CRON[11805]: (ubuntu) CMD (/usr/bin/python3.6 /home/ubuntu/Deploy/LSTM_Attention_IMDB_New_open.py >> /tmp/file)
Oct 2 04:32:04 escnn CRON[11804]: (CRON) info (No MTA installed, discarding output)
Oct 2 04:45:01 escnn CRON[11883]: (ubuntu) CMD (/usr/bin/python3.6 /home/ubuntu/Deploy/LSTM_Attention_IMDB_New_open.py >> /tmp/file)
Oct 2 04:46:11 escnn CRON[11882]: (CRON) info (No MTA installed, discarding output)
Oct 2 05:00:01 escnn CRON[11961]: (ubuntu) CMD (/usr/bin/python3.6 /home/ubuntu/Deploy/LSTM_Attention_IMDB_New_open.py >> /tmp/file)
Oct 2 05:01:00 escnn CRON[11960]: (CRON) info (No MTA installed, discarding output)
Oct 2 05:15:01 escnn CRON[12159]: (ubuntu) CMD (/usr/bin/python3.6 /home/ubuntu/Deploy/LSTM_Attention_IMDB_New_open.py >> /tmp/file)
Oct 2 05:17:01 escnn CRON[12225]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
Oct 2 05:17:27 escnn CRON[12158]: (CRON) info (No MTA installed, discarding output)
Oct 2 05:30:01 escnn CRON[12240]: (ubuntu) CMD (/usr/bin/python3.6 /home/ubuntu/Deploy/LSTM_Attention_IMDB_New_open.py >> /tmp/file)
Oct 2 05:31:05 escnn CRON[12239]: (CRON) info (No MTA installed, discarding output)