I've been encountered a strange phenomena.
I've been messing with Cron, so it runs a script called startup.sh, which it does.
First I wrote the script to send an email, but later I rewrote it to send a message instead.
However, when restarting the server, nothing happened.
Then I checked the status of cron, and was surprised that it had run the old script, which now didn't exist anymore.
Is there some kind of cron cache?
Here I'm checking the status:
It tried to run the mail script, which don't exist anymore, and it failed (worked before, but that's not the issue)
Then I checked the script file:
It was the new script, so where did cron run the other (now rewritten script) from?
I've of course restarted Linux, I've even tried to clear the cache, but it don't work..
.. So now I'm confused... (More than normal)
I've been messing with Cron, so it runs a script called startup.sh, which it does.
First I wrote the script to send an email, but later I rewrote it to send a message instead.
However, when restarting the server, nothing happened.
Then I checked the status of cron, and was surprised that it had run the old script, which now didn't exist anymore.
Is there some kind of cron cache?
Here I'm checking the status:
hellfire@Plex:~$ sudo systemctl status cron
[sudo] password for hellfire:
Code:
● cron.service - Regular background program processing daemon
Loaded: loaded (/lib/systemd/system/cron.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2020-01-20 20:57:56 CET; 1min 45s ago
Docs: man:cron(8)
Main PID: 537 (cron)
Tasks: 1 (limit: 3548)
CGroup: /system.slice/cron.service
└─537 /usr/sbin/cron -f
Jan 20 20:57:57 Plex cron[537]: (CRON) INFO (pidfile fd = 3)
Jan 20 20:57:57 Plex cron[537]: (CRON) INFO (Running @reboot jobs)
Jan 20 20:57:57 Plex CRON[565]: pam_unix(cron:session): session opened for user root by (uJan 20 20:57:57 Plex CRON[613]: (root) CMD (sleep 20 && /home/hellfire/startup.sh)
Jan 20 20:58:21 Plex sSMTP[866]: Creating SSL connection to host
Jan 20 20:58:21 Plex sSMTP[866]: SSL connection using ECDHE_RSA_AES_256_GCM_SHA384
Jan 20 20:58:21 Plex cron[537]: sendmail: 550 5.7.1 Username [email protected] and sender roJan 20 20:58:21 Plex sSMTP[866]: 550 5.7.1 Username [email protected] and sender [email protected] 20 20:58:21 Plex CRON[565]: (root) MAIL (mailed 75 bytes of output but got status 0x00 )
Jan 20 20:58:21 Plex CRON[565]: pam_unix(cron:session): session closed for user root
Then I checked the script file:
hellfire@Plex:~$ cat /home/hellfire/startup.sh
Code:
#!/bin/sh
smsT --command='m "Adam Larsson" Hellfire are ONLINE'
It was the new script, so where did cron run the other (now rewritten script) from?
I've of course restarted Linux, I've even tried to clear the cache, but it don't work..
.. So now I'm confused... (More than normal)