Jump to content


Photo

Cron to update time - at boot and every day


  • Please log in to reply
2 replies to this topic

#1 fced

  • Senior Member
  • 75 posts

0
Neutral

Posted 18 June 2012 - 19:59

Hello,
My dm500 with Openpli is disconnected from satellite so time is not correct...
Actually i update it manually with date command : date -s 2012.06.18-18:58:00

I would like to create a script (cron script) to update time during the boot (before other services start) and each day ...
For this, i have enabled Cron from DM500 -> System Setting -> Services
and i tried to create my cron script :

On the DM500 by telnet i typed crontab -e :
then i entered my script (to update time at each minute - just to see if it work) :
1 * * * * /sbin/rdate -s time.mit.edu
After this, i have found a new file (crontab.273) in /var/spool/cron with my command inside...

but nothing appear, no time update... nothing...
I tried also to duplicate the file to /var/spool/cron/crontab
i also renamed my file in "root" but nothing

Any idea please ?

Can someone help me please ?
Thankyou
Ced

Re: Cron to update time - at boot and every day #2 mirakels

  • Forum Moderator
    PLi® Core member
  • 7,599 posts

+62
Good

Posted 18 June 2012 - 21:59

1 * * * * will run your command every hour!
to get it once a day it must be something like "1 1 * * * command"


You should indeed have a file /var/spool/cron/crontabs/root containing your crontab entry.

Did you check if crond is running (check output of ps command?
Geen wonder... Had slechts een dm7000, maar wel ook een rotor. eigenlijk al een tijdje ook een dm600 en dm7025. Maar nu kijkend met een et9000 en vuduo

Re: Cron to update time - at boot and every day #3 fced

  • Senior Member
  • 75 posts

0
Neutral

Posted 20 June 2012 - 23:32

Hello,
May be crond is not running...
- How can i check if crond is running (i have enabled it from system setting->Services) - it's not visible in top command
- If i want to run a script at boot (before softcam stard), where should i put it ? - I want to execute this command rdate -s tick.greyware.com at boot, and every day...

ps : strangely, when i type crontab -e it create a file in : var/spool/cron not in var/spool/cron/crontabs...
Is this normal ?

when i type : "crontab" i get :

root@dm500 ~ # crontab
BusyBox v1.01 (2011.08.18-03:38+0000) multi-call binary

Usage: crontab [-c dir] {file|-}|[-u|-l|-e|-d user]

Edited by fced, 20 June 2012 - 23:35.



0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users