Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
145 user(s) are online (138 user(s) are browsing Forums)

Members: 1
Guests: 144

levellord, more...

Support us!

Headlines

 
  Register To Post  

Time Corrector Script
Quite a regular
Quite a regular


See User information
My AmigaOne loses about 2 seconds per hour, and it's been on for 8 days and is 7 minutes behind.

I was wondering if the script file below would work to reset the clock about once an hour. (I haven't used environment variables successfully ever, but I finally think I understand them. I'm 41 years old, have been using computers since I was 12, and let me tell you, the documentation is WORSE than atrocious, mostly.)

===
ChangeTaskPri -128
SetEnv Count 0
Lab Start
Wait 60 Min
SetClock Load
If $Count EQ 9
Ping
SetEnv Count 0
EndIf
Eval $Count + 1 to ENV:Count
Skip Start Back
===

Another problem I have is if I don't use the internet (cable modem) for about a day and a half, when I try to use AWeb (it's still running), it loses the connection. So, I was thinking that if I ping the net once every 9 hours or so, that I wouldn't get a dropped connection. What happens is, if I disconnect the ethernet cable from the back socket on the A1, unplug the modem from the electric socket (it doesn't have an on/off switch), then plug it back in, and into the computer, without restarting AWeb (3.5.08), I can use the internet again. (I'm quite amazed that it doesn't freak and shut down and/or guru the computer.)
I don't know what parameters I need to add to the ping command to get it to work.

Would this also work?
Eval $Count + 1 to $Count


I was thinking of calling it something like "TimeSync" and running it invisibly by,
run >nil: TimeSync
as a back ground process with no shell of it's own open on the desktop.

Support Amiga Fantasy cases!!!
How to program: 1. Start with lots and lots of 0's. 10. Add 1's, liberally.
"Details for OS 5 will be made public in the fourth quarter of 2007, ..." - Bill McEwen
Whoah!!! He spoke, a bit late.
Go to top
Re: Time Corrector Script
Just popping in
Just popping in


See User information
@Atheist

I use FACTS myself to keep my time correct but you do need an internet connection all the time.

Go to top
Re: Time Corrector Script
Just can't stay away
Just can't stay away


See User information
@Atheist

I have the same problem here. Not so long ago I had to move the time 20 minutes forwards because it was lagging behind. I've been thinking of looking into syncing the time with the net to fix this (once on startup would be enough IMO).

Of course before I can do anything about it I would have to get my A1 working again...

Go to top
Re: Time Corrector Script
Just can't stay away
Just can't stay away


See User information
@Atheist

Quote:
My AmigaOne loses about 2 seconds per hour, and it's been on for 8 days and is 7 minutes behind.

...

Another problem I have is if I don't use the internet (cable modem) for about a day and a half, when I try to use AWeb (it's still running), it loses the connection. So, I was thinking that if I ping the net once every 9 hours or so, that I wouldn't get a dropped connection.
You could try to solve both problems at once with by runing following script

Lab Start
date >NIL: *>NIL: server pool.ntp.org
Wait 60 Min
Skip Start Back

Quote:
Would this also work?
Eval $Count + 1 to $Count
No.
SetEnv Count `Eval $Count + 1`
Instead of SetEnv (global varibales) you should use Set (local varaibles) in such scripts. With SetEnv you couldn't run 2 scripts at the same time which use a variable "Count".

Go to top
Re: Time Corrector Script
Amigans Defender
Amigans Defender


See User information
@Atheist
You could also use Docket (cron-like utility) to just re-sync the time via joerg's "Date server pool.ntp.org" tip whenever you want your time synchronized.

ExecSG Team Lead
Go to top
Re: Time Corrector Script
Just popping in
Just popping in


See User information
@Atheist

Doesn't The internet time server update work in Time Prefs?

Best Regards,

Harry

[SOLD] ?A1-C, 512MB, Antec Aria
Go to top
Re: Time Corrector Script
Not too shy to talk
Not too shy to talk


See User information
@samwel

Yes it does & those that are lossing time had better check their cell battery voltage before they lose more then just time.

Look, only one leg, count em, one!
X1000/PA6T@1800MHz/2Gb/Radeon 4850

Go to top
Re: Time Corrector Script
Amigans Defender
Amigans Defender


See User information
@RussellB

Quote:

I use FACTS myself to keep my time correct but you do need an internet connection all the time.


No you don't. It should happily work away whether there is a connection or not (of course, it can only sync if there is a connection, so it may not solve the original problem)

The much-unreleased OS4 version had a clock drift option to determine and correct any time loss. I don't remember whether I ever got it to work properly.

Chris

Go to top
Re: Time Corrector Script
Quite a regular
Quite a regular


See User information
I've made the script file below:
-----
ChangeTaskPri -100
Lab Start
Wait 40 Min
Setclock load
Skip Start Back
-----

And found that "changetaskpri -100" just seems to freeze the shell at that command.
The history buffer can be scrolled through, but
break 8 c
break 8 d
break 8 e
break 8 f
from another shell won't unlock the shell changetaskpri command. The shell won't close when you click the close button in the upper left hand corner.

I started another shell and kept increasing the value until it locked, -67 doesn't lock, -68 does.

AOS pre-rel. 4

Support Amiga Fantasy cases!!!
How to program: 1. Start with lots and lots of 0's. 10. Add 1's, liberally.
"Details for OS 5 will be made public in the fourth quarter of 2007, ..." - Bill McEwen
Whoah!!! He spoke, a bit late.
Go to top
Re: Time Corrector Script
Quite a regular
Quite a regular


See User information
I thought the min/max for changetaskpri was -128 and 127.

Support Amiga Fantasy cases!!!
How to program: 1. Start with lots and lots of 0's. 10. Add 1's, liberally.
"Details for OS 5 will be made public in the fourth quarter of 2007, ..." - Bill McEwen
Whoah!!! He spoke, a bit late.
Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project