CRON scheduler ???

CRON scheduler ???

Postby wd9895 » Sat Oct 06, 2012 9:51 pm

Hi Jocko,

I patched the WOL patch for the CRON scheduler but now I noticed that the NAS shutdown rule also does not work properly.
I have a schedule of 22 (10pm) every day to shut down my NAS. I know 'bout the time offset of 1 hour (summertime ?).
But the NAS is shut down now just before midnight (23:45)

I think this behavior isn't right, is it ?


EDIT: It seems the CRON has a problem with the time ? WOL Shutdown works, NAS can be waked up again. But why acts CRON with a time of 22 hour when it's just midnight ??? :scratch
wd9895
Donator Supporter
Donator Supporter
 
Posts: 255
Joined: Fri Jun 10, 2011 1:49 pm
Location: Hamburg, Germany

Re: CRON scheduler ???

Postby Jocko » Sun Oct 07, 2012 10:04 am

Hi wd9895

I think you have an issue between your hardware time and system time. :scratch

So some questions to understand what happens...
- Do you use ntp servers ?
known issue: when the NAS reboot if it can't synchronize with the ntp servers, the system time is never adjusted and the hwtime have an offset equal to the value to your timezone.

- Can you test if your hwtime and systime are "synchronized". So in a putty window, do
Code: Select all
date;hwclock
Two times must be identical
Note : you can have also an offset of few minutes. Indeed the hwtime is only synchronized when you change some time options in the setup menu and as the hwtime derives several seconds per day with my nas, you can have an offset. Also, we added an additional synchronizing at each time you display the home menu in the web-interface.

-Can you try this if you had previously set the FTP server:
* set a ftp restart
* look at what time is reported in the FTP log when the server is restarting.
Note : Normally, it must be the cron time used.
Jocko
Site Admin - expert
 
Posts: 11529
Joined: Tue Apr 12, 2011 4:48 pm
Location: Orleans, France

Re: CRON scheduler ???

Postby wd9895 » Sun Oct 07, 2012 11:40 am

Hi Jocko,

root@Lacie-NS2:/ # date;hwclock
Sun Oct 7 13:34:41 GMT+2 2012
Sun Oct 7 13:34:41 2012 0.000000 seconds
root@Lacie-NS2:/ #


I set the GMT +2 to get a good result and you can see that both times are equal.

Let me test further.
In my understanding a cron job at 22:00 should work on 22:00, right after 22:01 it should do the next job on next day. It my expectation right ?
wd9895
Donator Supporter
Donator Supporter
 
Posts: 255
Joined: Fri Jun 10, 2011 1:49 pm
Location: Hamburg, Germany

Re: CRON scheduler ???

Postby Jocko » Sun Oct 07, 2012 11:56 am

wd9895 wrote:Let me test further.
In my understanding a cron job at 22:00 should work on 22:00, right after 22:01 it should do the next job on next day. It my expectation right ?


You are right. if in crontab you have this line :
22 * * * yourscript
then your script will performed only at 22:00:00 every day
but with this second line :
* 22 * * * yourscript
then your script will performed at each minute : 22:00:00; 22:01:00; ... upto 22:59:00
Jocko
Site Admin - expert
 
Posts: 11529
Joined: Tue Apr 12, 2011 4:48 pm
Location: Orleans, France

Re: CRON scheduler ???

Postby wd9895 » Sun Oct 07, 2012 12:33 pm

* 22 * * * yourscript



Uuuaaaaaahhhhhh !!

THAT was my mistake. Thanks for the "0" instead of the *
wd9895
Donator Supporter
Donator Supporter
 
Posts: 255
Joined: Fri Jun 10, 2011 1:49 pm
Location: Hamburg, Germany


Return to Lacie Network Space vs2 and max version

Who is online

Users browsing this forum: No registered users and 2 guests