Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-42808

Automated backups do not run when scheduled (or random timezone issue)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 2.5.4, 2.6.1
    • 2.5.3, 2.6
    • Backup
    • MOODLE_25_STABLE, MOODLE_26_STABLE
    • MOODLE_25_STABLE, MOODLE_26_STABLE
    • MDL-42808-master
    • Hide

      Testing instructions from MDL-28531.

      Test pre-requisites

      1. Remove any date.timezone from your php.ini (CLI/Apache)
      2. Enable automated backups (Settings > Site administration > Courses > Backups > Automated backup setup)
      3. Set the cron time to 6pm (or any time later than now)
      4. Enable today's day and Sunday
      5. Set your admin's user to server timezone (Settings > My profile settings > Edit profile)
      6. Your server timezone should be Australia/Perth (This is your machine setting)
      7. Tests are to be run one after the other (without reset except if specified)

      Test 1

      1. Create two new courses, one has to be hidden
      2. Run the cron
      3. Go to the backup report (Settings > Site administration > Reports > Backups)
      4. Make sure boths courses have been skipped
      5. Make sure they're set to run today at 6pm

      Test 2

      1. Create a new course
      2. Run the cron
      3. Go to the backup report
      4. Make sure all the courses have been skipped
      5. Make sure all the courses are scheduled for today at 6pm

      Test 3

      1. Change your system time to 7pm
      2. Run the cron
      3. Go to the backup report
      4. Make sure courses have been backed up
      5. Make sure courses are scheduled for Sunday at 6pm

      Test 4

      1. Reset your system to the correct time/date
      2. Change your admin's timezone to UTC-2
      3. Run the cron
      4. In the cron output, make sure courses are scheduled for tomorrow at 4am
      5. Go to the backup report
      6. Make sure courses are skipped
      7. Make sure they are scheduled for today at 6pm

      Test 5

      1. Change your system time to tomorrow at 5am
      2. Run the cron
      3. In the cron output, make sure courses are scheduled for Monday, 4 am
      4. Go to the backup report
      5. Make sure courses are backed up
      6. Make sure they are rescheduled for Sunday at 6am

      Test 6

      1. Run the Backup Unit Tests and make sure none fails
      Show
      Testing instructions from MDL-28531 . Test pre-requisites Remove any date.timezone from your php.ini (CLI/Apache) Enable automated backups (Settings > Site administration > Courses > Backups > Automated backup setup) Set the cron time to 6pm (or any time later than now) Enable today's day and Sunday Set your admin's user to server timezone (Settings > My profile settings > Edit profile) Your server timezone should be Australia/Perth (This is your machine setting) Tests are to be run one after the other (without reset except if specified) Test 1 Create two new courses, one has to be hidden Run the cron Go to the backup report (Settings > Site administration > Reports > Backups) Make sure boths courses have been skipped Make sure they're set to run today at 6pm Test 2 Create a new course Run the cron Go to the backup report Make sure all the courses have been skipped Make sure all the courses are scheduled for today at 6pm Test 3 Change your system time to 7pm Run the cron Go to the backup report Make sure courses have been backed up Make sure courses are scheduled for Sunday at 6pm Test 4 Reset your system to the correct time/date Change your admin's timezone to UTC-2 Run the cron In the cron output, make sure courses are scheduled for tomorrow at 4am Go to the backup report Make sure courses are skipped Make sure they are scheduled for today at 6pm Test 5 Change your system time to tomorrow at 5am Run the cron In the cron output, make sure courses are scheduled for Monday, 4 am Go to the backup report Make sure courses are backed up Make sure they are rescheduled for Sunday at 6am Test 6 Run the Backup Unit Tests and make sure none fails

      While exploring the Administration, I noticed that the backup scheduler was not running the backups at the right time. Having spent quite some time on it as part of MDL-28531, that surprised me.

      So I have investigated and the problem is not occurring in 2.4, but it is in 2.5 and master. The problem seems to come from the Google library that we have included in 2.5. Though this is not occurring if you have a timezone set in your php.ini.

      Google_Client.php
       
      if (! ini_get('date.timezone') && function_exists('date_default_timezone_set')) {
        date_default_timezone_set('UTC');
      }
      

      Reported upstream: http://code.google.com/p/google-api-php-client/issues/detail?id=422

            fred Frédéric Massart
            fred Frédéric Massart
            Ankit Agarwal Ankit Agarwal
            Damyon Wiese Damyon Wiese
            Rossiani Wijaya Rossiani Wijaya
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.