WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Running as server - need static ip and cron  (Read 5170 times)

Offline aug

  • Jr. Member
  • **
  • Posts: 74
Running as server - need static ip and cron
« on: March 31, 2016, 01:50:48 AM »
How can i set a static ip (at the moment i use the router and the mac) and have cron running after a reboot???

Offline gavinmc42

  • Sr. Member
  • ****
  • Posts: 301
Re: Running as server - need static ip and cron
« Reply #1 on: March 31, 2016, 06:55:34 PM »
See the end of this for static ip setups
http://forum.tinycorelinux.net/index.php?topic=19804.15

Ch 10 Bootcodes - Corebook
re cron - page 55/56
just add cron to cmdline boot file in mmcblk0p1

crontab -e to make and edit the cron file
It is a bit pedantic and archaic so be careful of the editing.

Offline aug

  • Jr. Member
  • **
  • Posts: 74
Re: Running as server - need static ip and cron
« Reply #2 on: April 01, 2016, 09:40:56 AM »
thanks ;-)

Offline aug

  • Jr. Member
  • **
  • Posts: 74
Re: Running as server - need static ip and cron
« Reply #3 on: April 01, 2016, 10:21:15 AM »
See the end of this for static ip setups
http://forum.tinycorelinux.net/index.php?topic=19804.15

Ch 10 Bootcodes - Corebook
re cron - page 55/56
just add cron to cmdline boot file in mmcblk0p1

crontab -e to make and edit the cron file
It is a bit pedantic and archaic so be careful of the editing.


ok with static ip (need to execute filetool.sh -b before rebooting) but cron did not really work. the daemon is started at boot but the file is missing. crontab -l shows only the message that it can't find the file..... after rebooting, without rebooting it works.

Offline jncl

  • Newbie
  • *
  • Posts: 38
Re: Running as server - need static ip and cron
« Reply #4 on: April 01, 2016, 10:38:42 AM »
Hi aug,

  You need to add var/spool/cron/crontabs to /opt/.filetool.lst and then filetool.sh -b so the crontab file is saved before you reboot.

HTH
  Jon

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11157
Re: Running as server - need static ip and cron
« Reply #5 on: April 01, 2016, 10:38:54 AM »
Hi aug
Quote
... the daemon is started at boot but the file is missing. crontab -l shows only the message that it can't find the file..... after rebooting, ...
Naybe you need to add  var/spool/cron/crontabs  to your backup?

Offline aug

  • Jr. Member
  • **
  • Posts: 74
Re: Running as server - need static ip and cron
« Reply #6 on: April 02, 2016, 11:10:38 AM »
after setting a fixed ip the date/time is 01.01.1970 00:01 - fine :-(
i can set the clock with the date command but how can i write it to the hardware clock (hwclock reports can't open /dev/misc/rtc)???

Offline jgrulich

  • Sr. Member
  • ****
  • Posts: 341
    • GRULICH DESIGN - R&D Lab.
Re: Running as server - need static ip and cron
« Reply #7 on: April 02, 2016, 01:51:09 PM »
If you like to get the ntp date and time, than you need to add this to the bootlocal.sh:
Code: (bash) [Select]
# Set the time
/etc/init.d/settime.sh

There is no RTC at the Raspberry board itself. But you may use one as a module connected to the GPIO if you like to have the time and date without the internet connection.

Offline gavinmc42

  • Sr. Member
  • ****
  • Posts: 301
Re: Running as server - need static ip and cron
« Reply #8 on: April 02, 2016, 11:12:28 PM »
If it is connected to the net, you may need to edit /etc/sysconfig/ntpserver
Else you will need a RTC if you don't have internet access for your server.
If it is going on a local network one of the other PCs  can be made a ntp sever for it.

You may need to make and backup  /etc/sysconfig/timezone file, add something like this.
TZ=EST-10


Offline aug

  • Jr. Member
  • **
  • Posts: 74
Re: Running as server - need static ip and cron
« Reply #9 on: April 03, 2016, 11:25:59 AM »
ok seems it had to add the script to bootlocal.sh
But what steps are need to set the correct time for Europe/Berlin???

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Re: Running as server - need static ip and cron
« Reply #10 on: April 03, 2016, 11:57:10 AM »
I'm using these boot codes
Code: [Select]
noutc tz=CET-1CEST,M3.5.0,M10.5.0/3
Download a copy and keep it handy: Core book ;)

Offline aug

  • Jr. Member
  • **
  • Posts: 74
Re: Running as server - need static ip and cron
« Reply #11 on: April 04, 2016, 09:29:52 AM »
I'm using these boot codes
Code: [Select]
noutc tz=CET-1CEST,M3.5.0,M10.5.0/3

used tz=CEST but still get only the utc :-(

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Re: Running as server - need static ip and cron
« Reply #12 on: April 04, 2016, 09:53:50 AM »
I don't know if the boot codes are different for piCore.
You may try editing  /etc/sysconfig/timezone  (using upper case TC=...) as gavinmc42 suggested.
Download a copy and keep it handy: Core book ;)

Offline aug

  • Jr. Member
  • **
  • Posts: 74
Re: Running as server - need static ip and cron
« Reply #13 on: April 04, 2016, 10:28:09 AM »
I don't know if the boot codes are different for piCore.
You may try editing  /etc/sysconfig/timezone  (using upper case TC=...) as gavinmc42 suggested.

The file is gone after reboot. Parameters used in commandline.txt seems to have no effect. It shows the other timezone name, but the value of the time remains the utc one.

Offline jgrulich

  • Sr. Member
  • ****
  • Posts: 341
    • GRULICH DESIGN - R&D Lab.
Re: Running as server - need static ip and cron
« Reply #14 on: April 04, 2016, 12:45:38 PM »
Copy this into the cmdline.txt at /mnt/mmcblk0p1:
Code: (bash) [Select]
wc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1 root=/dev/ram0 elevator=deadline rootwait quiet nortc loglevel=3 noembed nodhcp tz=CET-1CEST,M3.5.0,M10.5.0/3

Be sure that it is in ONE long uninterrupted line !!!