Se que esta pregunta la han hecho infinidad de veces, y tengo varias horas viendo posibles soluciones y ninguna encaja con lo que me pasa, así que me animé a hacer esta pregunta, porque debe ser un detalle, pero no logro verlo.
mi script
cat elorat /home/elorat/tareas/hora.sh
.
archivo='/home/elorat/logs/pagina/hora.log'
echo "" >> $archivo
echo date >> $archivo
echo ""
echo date
lo listo:
$ ll hora.sh
.
-rwxr-xr-x 1 elorat elorat 675 ene 13 20:12 hora.sh*
Lo agrego para que se ejecute cada minuto con mi perfil de usuario:
$ crontab -e
.
# 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
*/1 * * * * elorat /home/elorat/tareas/hora.sh
y esta es la salida del log del sistema tail -f /var/log/syslog
Jan 13 20:26:01 Aspire CRON[5110]: (elorat) CMD (elorat /home/elorat/tareas/hora.sh)
Jan 13 20:26:01 Aspire sSMTP[5111]: Creating SSL connection to host
Jan 13 20:26:02 Aspire sSMTP[5111]: SSL connection using ECDHE_RSA_CHACHA20_POLY1305
Jan 13 20:26:05 Aspire sSMTP[5111]: Sent mail for elorat@Aspire (221 2.0.0 closing connection y78sm22806913vsc.6 - gsmtp) uid=1000 username=elorat outbytes=618
Alguna idea que pueda ser?
ACTUALIZACION:
No existe el archivo /var/log/crontab
, pero ejecuté el comando:
$ journalctl -u cron.service
y esta es la salida...
.....
ene 13 21:37:01 Aspire CRON[8569]: pam_unix(cron:session): session opened for user elorat by (uid=0)
ene 13 21:37:02 Aspire sSMTP[8571]: Creating SSL connection to host
ene 13 21:37:02 Aspire sSMTP[8571]: SSL connection using ECDHE_RSA_CHACHA20_POLY1305
ene 13 21:37:05 Aspire sSMTP[8571]: Sent mail for elorat@Aspire (221 2.0.0 closing connection r8sm29995647uan.0 - gsmtp) uid=1000 username=elorat outbytes=618
ene 13 21:37:05 Aspire CRON[8569]: pam_unix(cron:session): session closed for user elorat
ene 13 21:38:01 Aspire CRON[8595]: pam_unix(cron:session): session opened for user elorat by (uid=0)
ene 13 21:38:01 Aspire sSMTP[8597]: Creating SSL connection to host
ene 13 21:38:02 Aspire sSMTP[8597]: SSL connection using ECDHE_RSA_CHACHA20_POLY1305
ene 13 21:38:06 Aspire sSMTP[8597]: Sent mail for elorat@Aspire (221 2.0.0 closing connection g195sm37329398vka.5 - gsmtp) uid=1000 username=elorat outbytes=618
ene 13 21:38:06 Aspire CRON[8595]: pam_unix(cron:session): session closed for user elorat
ene 13 21:39:01 Aspire CRON[8653]: pam_unix(cron:session): session opened for user root by (uid=0)
ene 13 21:39:01 Aspire CRON[8654]: pam_unix(cron:session): session opened for user elorat by (uid=0)
ene 13 21:39:01 Aspire CRON[8653]: pam_unix(cron:session): session closed for user root
ene 13 21:39:01 Aspire sSMTP[8657]: Creating SSL connection to host
ene 13 21:39:02 Aspire sSMTP[8657]: SSL connection using ECDHE_RSA_CHACHA20_POLY1305
ene 13 21:39:05 Aspire sSMTP[8657]: Sent mail for elorat@Aspire (221 2.0.0 closing connection n15sm35139864uao.18 - gsmtp) uid=1000 username=elorat outbytes=618
ene 13 21:39:05 Aspire CRON[8654]: pam_unix(cron:session): session closed for user elorat
ene 13 21:40:01 Aspire CRON[8898]: pam_unix(cron:session): session opened for user elorat by (uid=0)
ene 13 21:40:01 Aspire sSMTP[8900]: Creating SSL connection to host
ene 13 21:40:02 Aspire sSMTP[8900]: SSL connection using ECDHE_RSA_CHACHA20_POLY1305
ene 13 21:40:05 Aspire sSMTP[8900]: Sent mail for elorat@Aspire (221 2.0.0 closing connection w65sm64706287vsc.16 - gsmtp) uid=1000 username=elorat outbytes=618
ene 13 21:40:05 Aspire CRON[8898]: pam_unix(cron:session): session closed for user elorat
/var/log/crontab.log
a ver que error marca