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

    Scheduled Tasks (Delayed / Cron-style) not working, but instant tasks are.

    Scheduled Pinned Locked Moved Solved
    FOG Problems
    4
    13
    781
    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.
    • H
      hj104
      last edited by

      Thanks for the suggestion but that didn’t work.

      I unplugged the device for 10 seconds, then sent an instant WOL, which booted, so I unplugged it again for 10 seconds, then scheduled one for 2 minutes later, and it didn’t boot, so it appears to be the same behaviour.

      george1421G 1 Reply Last reply Reply Quote 0
      • george1421G
        george1421 Moderator @hj104
        last edited by

        @hj104 OK so what we now know is that Windows is not messing with you so here, so we should look within the FOG code to understand what is different. Sometimes you have to find where the problem isn’t to find where it is.

        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!

        1 Reply Last reply Reply Quote 0
        • S
          Sebastian Roth Moderator
          last edited by

          @hj104 said in Scheduled Tasks (Delayed / Cron-style) not working, but instant tasks are.:

          then sent an instant WOL

          Did you send the WOL by itself or just an instant task?

          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

          H 1 Reply Last reply Reply Quote 0
          • H
            hj104 @Sebastian Roth
            last edited by

            @Sebastian-Roth Hi, I sent an instant task.

            1 Reply Last reply Reply Quote 0
            • Tom ElliottT
              Tom Elliott
              last edited by

              How about the most relevant question of all, maybe I missed it, what version of fog are you running?

              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
              • Tom ElliottT
                Tom Elliott
                last edited by

                Also what does the task scheduler log show?

                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

                H 1 Reply Last reply Reply Quote 0
                • H
                  hj104 @Tom Elliott
                  last edited by

                  @Tom-Elliott

                  I’m running 1.5.7.

                  Here is the output of /opt/fog/log/fogscheduler.log

                  [root@localhost log]# tail -n 10 fogscheduler.log
                  [01-15-20 12:46:50 am]  * No tasks found!
                  [01-15-20 12:47:50 am]  * No tasks found!
                  [01-15-20 12:48:50 am]  * No tasks found!
                  [01-15-20 12:49:50 am]  * No tasks found!
                  [01-15-20 12:50:50 am]  * No tasks found!
                  [01-15-20 12:51:50 am]  * No tasks found!
                  [01-15-20 12:52:50 am]  * No tasks found!
                  [01-15-20 12:53:50 am]  * No tasks found!
                  [01-15-20 12:54:50 am]  * No tasks found!
                  [01-15-20 12:55:50 am]  * No tasks found!
                  

                  At 12:36pm, prior to taking that output, I scheduled a delayed task for 12:38pm. As you can see, nothing appeared in the log.

                  Note that those times around midnight are definitely incorrect, I was not working on it at that time and the server was off at that time as I shutdown my computer over night. Despite that, I would still expect that scheduling a cron-style task at * * * * * would work regardless of any time discrepancies right?

                  Thanks

                  Tom ElliottT 1 Reply Last reply Reply Quote 0
                  • Tom ElliottT
                    Tom Elliott @hj104
                    last edited by

                    @hj104 Chances are the time is based on UTC time, as FOG_TZ_INFO (in fog settings) is likely unset at the moment.

                    I’m guessing here, that the task scheduler appears to be checking every minute?

                    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
                    • S
                      Sebastian Roth Moderator
                      last edited by Sebastian Roth

                      @hj104 I have just tested on a fresh install and both delayed and cron-style work perfectly fine. My log looks like this:

                      cron-style / * * * * *

                      [01-18-20 10:31:05 pm]  * No tasks found!
                      [01-18-20 10:32:05 pm]  * No tasks found!
                      [01-18-20 10:33:05 pm]  * No tasks found!
                      [01-18-20 10:34:05 pm]  * 1 task found.
                      [01-18-20 10:34:05 pm]  * Task run time: Sat, 18 Jan 2020 22:34:00 +0000
                      [01-18-20 10:34:05 pm]  * Found a task that should run.
                      [01-18-20 10:34:05 pm] 		 - Is a host based task.
                      [01-18-20 10:34:05 pm] 		 - Unicast task found!
                      [01-18-20 10:34:05 pm] 		 - Host hostname
                      [01-18-20 10:34:06 pm] 		 - Tasks started for host hostname!
                      [01-18-20 10:35:05 pm]  * Sending 1 wake on lan request.
                      [01-18-20 10:35:05 pm]  * 1 total mac attempting to wake up.
                      

                      delayed task set to 22:37 (10:37 PM):

                      [01-18-20 10:35:06 pm]  * No tasks found!
                      [01-18-20 10:36:05 pm]  * Sending 1 wake on lan request.
                      [01-18-20 10:36:05 pm]  * 1 total mac attempting to wake up.
                      [01-18-20 10:36:06 pm]  * 1 task found.
                      [01-18-20 10:36:06 pm]  * Task run time: Sat, 18 Jan 2020 22:37:00 +0000
                      [01-18-20 10:37:06 pm]  * Sending 1 wake on lan request.
                      [01-18-20 10:37:06 pm]  * 1 total mac attempting to wake up.
                      [01-18-20 10:37:06 pm]  * 1 task found.
                      [01-18-20 10:37:06 pm]  * Task run time: Sat, 18 Jan 2020 22:37:00 +0000
                      [01-18-20 10:37:06 pm]  * Found a task that should run.
                      [01-18-20 10:37:06 pm] 		 - Is a host based task.
                      [01-18-20 10:37:06 pm] 		 - Unicast task found!
                      [01-18-20 10:37:06 pm] 		 - Host hostname
                      

                      Note that those times around midnight are definitely incorrect, I was not working on it at that time

                      While I am not sure this is causing the problem I would definitely try to start looking at this first. You said you have checked timezone in the FOG GUI. Do we talk about TZ INFO in FOG Configuration -> FOG Settings -> General Settings? After changes here you need to restart the scheduler service (systemctl restart FOGScheduler).

                      The PHP time is correct I think, I tested it by creating a .php file that does “echo date(‘Format String’, time());”

                      Did you run this on the command line or on the web server? If it was command line that might be different to what you get on the web server because configuration can differ. So please try this code on the FOG web server:

                      <?php
                          $tz = new DateTimeZone('Europe/Berlin'); // use your timezone identifier here!
                          $d = new DateTime('now', $tz);
                          echo $d->format('m-d-y g:i:s a');
                      ?>
                      

                      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
                      • H
                        hj104
                        last edited by

                        @Sebastian-Roth @Tom-Elliott

                        Hi,

                        Both delayed and cron-style scheduled tasks are now working for me.

                        After reading Sebastian’s reply, I ran the provided PHP code on the web server and the time was correct.

                        I then double checked TZ INFO in FOG Configuration -> FOG Settings -> General Settings and it was indeed set to the correct time zone, but I pressed update anyway and then I ran systemctl restart FOGScheduler.

                        As soon as I ran that command, my test computer turned on. Here is the log output from that time:

                        [01-20-20 11:31:06 am] Interface Ready with IP Address: 127.0.0.1
                        [01-20-20 11:31:06 am] Interface Ready with IP Address: 127.0.1.1
                        [01-20-20 11:31:06 am] Interface Ready with IP Address: 192.168.20.17
                        [01-20-20 11:31:06 am] Interface Ready with IP Address: localhost.localdomain
                        [01-20-20 11:31:06 am]  * Starting TaskScheduler Service
                        [01-20-20 11:31:06 am]  * Checking for new items every 60 seconds
                        [01-20-20 11:31:06 am]  * Starting service loop
                        [01-20-20 11:31:06 am]  * 3 tasks found.
                        [01-20-20 11:31:06 am]  * Task run time: Fri, 17 Jan 2020 12:38:00 +1100
                        [01-20-20 11:31:06 am]  * Found a task that should run.
                        [01-20-20 11:31:06 am]           - Is a host based task.
                        [01-20-20 11:31:06 am]           - Unicast task found!
                        [01-20-20 11:31:06 am]           - Host cg1new
                        [01-20-20 11:31:06 am]           - Tasks started for host cg1new!
                        [01-20-20 11:31:06 am]  * Task run time: Thu, 16 Jan 2020 11:11:00 +1100
                        

                        The time in the log is also correct now. I’ve never ran systemctl restart FOGScheduler before but I have restarted my FOG server multiple times since setting TZ INFO.

                        My only question now is whether restarting the server has the same effect on the FOGScheduler service as running systemctl restart FOGScheduler?

                        Thanks for the assistance.

                        1 Reply Last reply Reply Quote 0
                        • S
                          Sebastian Roth Moderator
                          last edited by

                          @hj104 said in Scheduled Tasks (Delayed / Cron-style) not working, but instant tasks are.:

                          My only question now is whether restarting the server has the same effect on the FOGScheduler service as running systemctl restart FOGScheduler?

                          I am pretty much sure this can be answered with yes. Sorry but I have no idea why this was wrong in the first place but working now. Seems like you have not changed anything.

                          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

                          253

                          Online

                          12.0k

                          Users

                          17.3k

                          Topics

                          155.2k

                          Posts
                          Copyright © 2012-2024 FOG Project