Score:1

How to disable cron service delay on startup?

dz flag

I'm trying to add the execution of a shell script on server startup. I do it using cron, so I configured it with 'crontab -e' command. It looks so:

@reboot /home/user/run.sh

Then I enabled a service with:

sudo systemctl enable cron.service

But when I reboot my server, jobs are not started. I check the service status with:

sudo systemctl status cron.service

screenshot with a service status after startup

And there is a message that it's 2h 55min left to start executing all jobs. So, as I understood service is running but with 3 hours delay. It's happening after every server startup.

Using sudo systemctl restart cron.service command helps to make service working, but the server skips @reboot jobs because "it's not system startup".

user535733 avatar
cn flag
Review your logs and .service file to determine the reason for cron's delay.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.