Tiny Core Linux

Tiny Core Base => Raspberry Pi => Topic started by: lnrobby on July 18, 2018, 08:58:38 AM

Title: How to get crond to wait for NTP
Post by: lnrobby on July 18, 2018, 08:58:38 AM
I am new to tinycore (and linux) so this question may be simple and I just haven't found it on google.

I am using bootlocal.sh to start crond. Is there any way to wait for a good system time before it starts up?

Presently I have a sleep 30 after starting up wifi which works fine but seems a bit hit and miss.

Thanks

Len
Title: Re: How to get crond to wait for NTP
Post by: Greg Erskine on July 18, 2018, 06:17:03 PM
hi lnrobby,

To start cron I think you should use the "cron" bootcode then /etc/init.d/tc-config handles the startup of cron at the right time.

regards
Greg
Title: Re: How to get crond to wait for NTP
Post by: curaga on July 19, 2018, 04:31:57 AM
Look in settime.sh, there's a loop that waits until the time is not older than 2015.
Title: Re: How to get crond to wait for NTP
Post by: gavinmc42 on July 19, 2018, 07:29:23 AM
I have a shell script loop that checks for the IP address at the start.
Most of mine run behind a firewall so they needed the ip address for the local NTP server too.

There are two main files that are useful for putting these in.
bootlocal.sh and bootstart.sh if I remember right?
Title: Re: How to get crond to wait for NTP
Post by: lnrobby on July 21, 2018, 04:26:46 AM
Got it working by using the boot code for cron.

I did have some trouble locating information on how to do this at first, and found it is dependant on the particular PI you are using.

I found this article.
/https://iotbytes.wordpress.com/change-picore-boot-codes-boot-options/

Thanks for the help
Title: Re: How to get crond to wait for NTP
Post by: bmarkus on July 21, 2018, 12:28:49 PM

and found it is dependant on the particular PI you are using.
 

Can you explain what do you mean?
Title: Re: How to get crond to wait for NTP
Post by: Greg Erskine on July 21, 2018, 08:48:28 PM
hi bmarkus,

Quote from linked article:

Quote
You can edit the “cmdline” file based on your Raspberry Pi Model and change the Boot Codes as per your requirements. For me, the file name is “cmdline3.txt” (as I am using Raspberry Pi 3), so I will use the following command to change Boot Codes

regards
Greg