• Recent
  • Unsolved
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login
  • Recent
  • Unsolved
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login

PowerManagement Cron DayOfWeek

Scheduled Pinned Locked Moved Solved
Bug Reports
3
10
1.7k
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F
    FritzBox360
    last edited by Oct 23, 2017, 9:46 AM

    Server: 14.04.1-Ubuntu x64
    Fog: Running Version 1.4.4 | SVN Revision: 6077

    Hi,
    i have some trouble with the PowerManagement scheduled power tasks.

    If i use the d-o-w option e.g. 1-5 for Mon-Fri like 15 8 * * 1-5 for a WOL-task it ignores the dow 1-5 and keeps starting on weekends.

    If i use only one day linke 20 11 * * 2 it works fine and shows right in the fogscheduler.log.

    If i use sth. like 20 11 * * 2-5 it shows next task

    Task run time: Mon, 23 Oct 2017 11:41:18 +0200
    

    But as the 2-5 says it should be 11:20 on every day-of-week from Tuesday through Friday.

    I assume it is sth. with the syntax oder with the code. Could not find sth. similar in the forum or the wiki.

    Some ideas here? My server-date is correct 🙂

    Thanks!

    1 Reply Last reply Reply Quote 0
    • T
      Tom Elliott
      last edited by Oct 23, 2017, 12:28 PM

      Do all other stepped patterns work properly then? I ask because I don’t have a good means to test currently.

      The stepped patterns are all handled by the same method, so I would suspect the same issue occurs on all stepped patterns correct?

      6 = Saturday
      5 = Friday
      4 = Thursday
      3 = Wednesday
      2 = Tuesday
      1 = Monday
      0 or 7 = Sunday

      Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

      Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

      Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

      1 Reply Last reply Reply Quote 0
      • F
        FritzBox360
        last edited by Oct 23, 2017, 12:49 PM

        @Tom-Elliott - thanks for your reply!

        Yes, all other days work but only if i use it seperated. If i use it combined like 1-3 it ignores this value and sets it like an * because it takes the whole week.

        1 Reply Last reply Reply Quote 0
        • F
          FritzBox360
          last edited by Oct 23, 2017, 1:01 PM

          @Tom-Elliott FYI:

          If i use the “-” for a range of values e.g. 1-5 there is a problem. If i seperate the values like 1,2,3,4,5 it seems correct.

          I will do some more testing…

          T 1 Reply Last reply Oct 24, 2017, 1:15 PM Reply Quote 0
          • T
            Tom Elliott @FritzBox360
            last edited by Oct 24, 2017, 1:15 PM

            @fritzbox360 I’m not asking specifically about “DOW” in this case. The , / and - characters all use the same functions regardless of the element in use. Min, Hour, DOM, Month, or DOW. I’m just trying to confirm if the problem with -'s occurs on any field.

            Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

            Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

            Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

            F 1 Reply Last reply Oct 25, 2017, 11:08 AM Reply Quote 0
            • F
              FritzBox360 @Tom Elliott
              last edited by Oct 25, 2017, 11:08 AM

              @tom-elliott okay, so i tested it with 50-55 * * * * to check if the “-” is a problem.

              The fogscheduler.log found a wake on lan task that should run.

              [10-25-17 12:49:52 pm]  * Task run time: Wed, 25 Oct 2017 12:49:52 +0200
              [10-25-17 12:49:52 pm]  * Found a wake on lan task that should run.
              [10-25-17 12:49:52 pm]  | Task sent to COMPUTER
              

              But keeps on going …

              [10-25-17 12:58:52 pm]  * Task run time: Wed, 25 Oct 2017 12:58:52 +0200
              [...]
              [10-25-17 1:00:52 pm]  * Task run time: Wed, 25 Oct 2017 13:00:52 +0200
              [10-25-17 1:00:52 pm]  * Found a wake on lan task that should run.
              [...]
              

              This would confirm that sth. with the “-” is translated to “*” because than it would be * * * * which should mean “At every minute.” That would also explain why it started at minute 49 …

              So i think there is a global problem.

              1 Reply Last reply Reply Quote 0
              • S
                Sebastian Roth Moderator
                last edited by Dec 2, 2017, 12:25 PM

                @Tom-Elliott Just bumping this so we don’t loose track of it.

                Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

                Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

                1 Reply Last reply Reply Quote 0
                • T
                  Tom Elliott
                  last edited by Jan 22, 2018, 11:55 PM

                  I want to bump this, but I’m afraid I don’t have a good mechanism to test this right now. I’m working on a php script so I can try to see what’s going on though.

                  Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

                  Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

                  Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

                  1 Reply Last reply Reply Quote 0
                  • T
                    Tom Elliott
                    last edited by Tom Elliott Jan 22, 2018, 7:56 PM Jan 23, 2018, 12:14 AM

                    Found and fixed.

                    If you need a quick fix, edit /var/www/fog/lib/fog/fogcron.class.php

                    Look for:

                    return (bool)($num = $low);
                    

                    It should show up on line 45 (or very close to it).

                    Make it read as:

                    return (bool)($num == $low);
                    

                    It should be noted this will be fixed in RC 11.

                    EDIT 1: More accurately, we should actually replace with:

                    return (bool)($num >= $low) && ($num <= $high);
                    

                    Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

                    Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

                    Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

                    1 Reply Last reply Reply Quote 0
                    • T
                      Tom Elliott
                      last edited by Jan 23, 2018, 11:55 AM

                      And if you want the latest file that appears to be working FAR more accurately/appropriately:

                      wget -O /var/www/fog/lib/fog/fogcron.class.php https://raw.githubusercontent.com/FOGProject/fogproject/working/packages/web/lib/fog/fogcron.class.php
                      

                      Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

                      Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

                      Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

                      1 Reply Last reply Reply Quote 0
                      • 1 / 1
                      • First post
                        Last post

                      150

                      Online

                      12.0k

                      Users

                      17.3k

                      Topics

                      155.2k

                      Posts
                      Copyright © 2012-2024 FOG Project