Wrong Date and time

Re: Wrong Date and time

Postby myo38 » Sat Nov 19, 2022 7:48 am

Hi,

No change. My trick didn't work.
It is as if at boot time the cron doesn't work, although it works well when I run it thru ssh.
How would I do to make is an iterative cron, let's say evey hour ?

Thanks,
Michel
myo38
Donator VIP
Donator VIP
 
Posts: 34
Joined: Thu Jun 30, 2022 6:49 am
Location: France - Tours

Re: Wrong Date and time

Postby Jocko » Sat Nov 19, 2022 10:08 am

Hi

Before changing the method, can you post
Code: Select all
cat /boot.log
and also enable debug mode
Code: Select all
debugon
, reboot the nas and post again
Code: Select all
cat /boot.log
cat /var/log/messages
after this last boot disable it
Code: Select all
debugoff


Other point a new version where the script checks internet connection if not it repeats the test every 15" for 15min. It is also more verbose to understand better what happens. So replace your version by the attached file
You do not have the required permissions to view the files attached to this post.
Jocko
Site Admin - expert
 
Posts: 11558
Joined: Tue Apr 12, 2011 4:48 pm
Location: Orleans, France

Re: Wrong Date and time

Postby myo38 » Sat Nov 19, 2022 5:56 pm

Jocko,

Thanks a lot for helping me !

Please find attached two file :
. log before was what you required
. log after is the same after a restart with the new cron you gave me

I'm curious to see the result of the new cron tomorrow morning !

Michel.
You do not have the required permissions to view the files attached to this post.
myo38
Donator VIP
Donator VIP
 
Posts: 34
Joined: Thu Jun 30, 2022 6:49 am
Location: France - Tours

Re: Wrong Date and time

Postby Jocko » Sat Nov 19, 2022 6:42 pm

Hi

Sorry but it won't work.

on both cases, the cron boot script is not performed. In boot.log, some lines are missing
Code: Select all
executing user boot commands
LED settings
So before line "LED settings" you should have at least the lines
Code: Select all
MAJ de l'heure oprès boot
   /direct-usb/fvdw/cron-boot/restart-sync-ntp-daemon.php
user boot commands ended
(with the previous boot script and more lines with the last version) :whistle
At least, as you have the line "executing user boot commands" that means the feature is really enabled.

You may get this behaviour if :
* the file "/rw_fs/etc/cronbootscript.sh" is corrupted, surely because the line "user boot commands ended" is missing (maybe you edited it in a MAC or Windows environment and in this case the breaklines are misencoded)
* you have change the name of the script in /direct-usb/fvdw/cron-boot

So post
Code: Select all
ls -al /rw_fs/etc/cronbootscript.sh
ls -al /direct-usb/fvdw/cron-boot
cat /rw_fs/etc/bootscripts.db
cp /rw_fs/etc/cronbootscript.sh /direct-usb/fvdw
chmod 777 /direct-usb/fvdw/cronbootscript.sh


Please to attach the file present in /direct-usb/fvdw

You may repair cronbootscript.sh by disabling/enabling again the boot jobs feature from Boot jobs menu (but do it only after copying it in fvdw share)
Jocko
Site Admin - expert
 
Posts: 11558
Joined: Tue Apr 12, 2011 4:48 pm
Location: Orleans, France

Re: Wrong Date and time

Postby myo38 » Sun Nov 20, 2022 2:49 pm

Hi,

I was going to tell you that it was as if the startup cron wasn't run ! Because a manual run gets the result.

Do, it didn't work.

And I didn't do any of the change you suggest I could have made.

Here is the listing of what you aked me for :
--------------------------------------
Code: Select all
 php -f /direct-usb/fvdw/cron-boot/restart-sync-ntp-daemon.php
Check Internet Connection...
                Getting WAN access :    [ OK ]
                Start NTPD service :    [ OK ]

root@Serveur-Maison:/ # ls -al /rw_fs/etc/cronbootscript.sh
-rwxr-xr-x  1 nobody nobody 542 2018-01-01 21:29 /rw_fs/etc/cronbootscript.sh

root@Serveur-Maison:/ # ls -al /direct-usb/fvdw/cron-boot
total 60
drwxrwxrwx  2 root   root    4096 2022-11-19 18:55 .
drwxrwxrwx  6 root   root    4096 2022-07-27 18:06 ..
-rw-rw-rw-  1 nobody nobody 15253 2022-11-19 18:51 log after.doc
-rw-rw-rw-  1 nobody nobody 23822 2022-11-19 18:44 log before.doc
-rw-rw-rw-  1 nobody nobody   934 2022-11-17 11:48 restart-sync-ntp-daemon old 2 .php
-rw-rw-rw-  1 nobody nobody   830 2018-01-01 13:58 restart-sync-ntp-daemon old.php
-rw-rw-rw-  1 nobody nobody  1322 2018-01-02 00:30 restart-sync-ntp-daemon.php

root@Serveur-Maison:/ # cat /rw_fs/etc/bootscripts.db
0:/direct-usb/fvdw/cron-boot/restart-sync-ntp-daemon old 2 .php:
0:/direct-usb/fvdw/cron-boot/restart-sync-ntp-daemon old.php:
1:/direct-usb/fvdw/cron-boot/restart-sync-ntp-daemon.php:

root@Serveur-Maison:/ # cp /rw_fs/etc/cronbootscript.sh /direct_usb/fvdw
cp: cannot create regular file `/direct_usb/fvdw': No such file or directory

root@Serveur-Maison:/ # chmod 777 /direct-usb/fvdw/cronbootscript.sh
chmod: cannot access `/direct-usb/fvdw/cronbootscript.sh': No such file or directory

root@Serveur-Maison:/ #
-------------------------------------------

It seems that the before last command (cp) isn't good.

Michel.
myo38
Donator VIP
Donator VIP
 
Posts: 34
Joined: Thu Jun 30, 2022 6:49 am
Location: France - Tours

Re: Wrong Date and time

Postby Jocko » Sun Nov 20, 2022 7:10 pm

Hi

Indeed I made an error in cp command line.

So do
Code: Select all
cp /rw_fs/etc/cronbootscript.sh /direct_usb/fvdw/cronbootscript.sh
chmod 777 /direct-usb/fvdw/cronbootscript.sh


Then export here the new file. The issue is on this file and I want to examine it
Jocko
Site Admin - expert
 
Posts: 11558
Joined: Tue Apr 12, 2011 4:48 pm
Location: Orleans, France

Re: Wrong Date and time

Postby myo38 » Mon Nov 21, 2022 3:53 pm

Jocko,

here it is. It was firect-usb and not direct_usb, but I could find this one !

I mlade the .sh file a .doc to make it allowed.

Michel
You do not have the required permissions to view the files attached to this post.
myo38
Donator VIP
Donator VIP
 
Posts: 34
Joined: Thu Jun 30, 2022 6:49 am
Location: France - Tours

Re: Wrong Date and time

Postby Jocko » Mon Nov 21, 2022 4:02 pm

:thinking nothing wrong . is it the version after you disabled/enabled again the feature Boot jobs ?

and if you run manually it what it returns with this command
Code: Select all
sh -x /rw_fs/etc/cronbootscript.sh
Jocko
Site Admin - expert
 
Posts: 11558
Joined: Tue Apr 12, 2011 4:48 pm
Location: Orleans, France

Re: Wrong Date and time

Postby myo38 » Mon Nov 21, 2022 5:02 pm

Hi,

I redid the enable/disable and find the resulting file ''.sh' attached

Here is the result of the manual run :
-----------------------------------
root@Serveur-Maison:/ # sh -x /rw_fs/etc/cronbootscript.sh
+ /bin/grep+ /usr/bin/awk -F " {print $4 }
"boot_type" /etc/inc/globals.inc
+ boot_type=regular
+ [ regular = fs_setup ]
+ FILE=/direct-usb/fvdw/cron-boot/restart-sync-ntp-daemon.php
+ [ -f /direct-usb/fvdw/cron-boot/restart-sync-ntp-daemon.php ]
+ echo -e \n\t
+ echo -e \t/direct-usb/fvdw/cron-boot/restart-sync-ntp-daemon.php
+ /usr/bin/php -f /direct-usb/fvdw/cron-boot/restart-sync-ntp-daemon.php
+ echo -e \nuser boot commands ended
root@Serveur-Maison:/ #
-------------------------------------

Thanks again,
Michel
myo38
Donator VIP
Donator VIP
 
Posts: 34
Joined: Thu Jun 30, 2022 6:49 am
Location: France - Tours

Re: Wrong Date and time

Postby Jocko » Mon Nov 21, 2022 5:13 pm

myo38 wrote:I redid the enable/disable and find the resulting file ''.sh' attached
So we will never know what was the issue because this action repaired it.

And as expected, the script run right. Now I think it will work when you will reboot the nas.

So wait on next rebooting
Jocko
Site Admin - expert
 
Posts: 11558
Joined: Tue Apr 12, 2011 4:48 pm
Location: Orleans, France

PreviousNext

Return to Lacie cloudbox (white casing)

Who is online

Users browsing this forum: No registered users and 10 guests