LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-01-2010, 11:33 PM   #1
bendib
Member
 
Registered: Feb 2009
Location: I'm the rat in your couch.
Distribution: Fedora on servers, Debian on PPC Mac, custom source-built for desktops
Posts: 174

Rep: Reputation: 40
Gift to community: A stupid little app to keep your clock accurate


Hello, I am learning C++, and made what seems to be my first useful, no matter how small, daemon that updates your system clock for you every half hour. It's built for x86, but can be recompiled for PPC. I made this because my system's clock wanders after a few days, even if by a few seconds. The installer likes fedora, because it adds TimeKeeper to /etc/rc.local, but it runs on others, too. You'll have to launch it by hand or use whatever your distro uses though. Copy it to /bin or /sbin so it can respawn, or it will update your clock once and terminate. Do not rename it. It's only a few lines long, but I thought I would save you the trouble. Remember to launch it in a terminal as timekeeperd& unless you want to keep your terminal open for half an hour.

It depends on ntpdate and sleep.

To download the tarball from my server which has an x86 version and the source from my server, click here: http://geekinsnthings.homelinux.org/...er-2.50.tar.gz

EDIT: I made a new version that does not fill your screen with worthless output and that updates your clock BEFORE waiting half an hour, so I changed the link to point to that version. It also has a native PPC build. EDIT AGAIN: Added ANOTHER version that gives you the credits and does not have to relaunch itself and just loops the parts of the process that do not give the credits.

Hope you find it useful, though you probably could have made it in 10Mins or less.

-Ben

Last edited by bendib; 03-02-2010 at 10:28 PM.
 
Old 03-02-2010, 02:52 AM   #2
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
Can't you also use ntpd ? It's true that I don't, I set the time manually once in a while.
 
Old 03-02-2010, 06:05 AM   #3
wje_lq
Member
 
Registered: Sep 2007
Location: Mariposa
Distribution: FreeBSD,Debian wheezy
Posts: 811

Rep: Reputation: 179Reputation: 179
If you don't want to rely on network resources for keeping your system clock accurate, hwclock is probably your best bet. For more information:
Code:
man hwclock
Then search for the word "adjust".
 
Old 03-02-2010, 10:26 PM   #4
bendib
Member
 
Registered: Feb 2009
Location: I'm the rat in your couch.
Distribution: Fedora on servers, Debian on PPC Mac, custom source-built for desktops
Posts: 174

Original Poster
Rep: Reputation: 40
My problem is that sometimes my hardware clock is inaccurate for some reason as well, which is why I use NTPDATE. Thanks. Releasing another updated version...
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Torvalds' gift for the Linux community... The new Kernel 2.6.28 LXer Syndicated Linux News 0 12-31-2008 01:12 PM
LXer: Trovalds' gift for the Linux community... The new Kernel 2.6.28 LXer Syndicated Linux News 0 12-31-2008 11:41 AM
LXer: What Is Your Holiday Gift to the Linux Community? LXer Syndicated Linux News 0 12-27-2008 03:01 AM
Is this really an accurate view of the linux community? purelithium Linux - General 12 10-22-2005 02:11 PM
Keeping my clock accurate with crontab jspaceman Slackware 7 02-27-2004 03:12 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:15 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration