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

    Clear Image History From All Host

    Scheduled Pinned Locked Moved
    General
    3
    7
    2.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.
    • Raymond BellR
      Raymond Bell Testers
      last edited by

      Just wanting to know if there a way to clear the image history from all host? I have host that have alot of history back to 4 years ago

      Raymond Bell
      WiKi: https://wiki.fogproject.org/wiki/index.php/Main_Page

      1 Reply Last reply Reply Quote 0
      • Wayne WorkmanW
        Wayne Workman
        last edited by

        maybe truncate the history table, or the tasks table.

        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!
        Daily Clean Installation Results:
        https://fogtesting.fogproject.us/
        FOG Reporting:
        https://fog-external-reporting-results.fogproject.us/

        1 Reply Last reply Reply Quote 0
        • Raymond BellR
          Raymond Bell Testers
          last edited by

          @Wayne-Workman would it be like this

          mysql -u root <-p password> fog
          truncate table history;
          exit;```

          Raymond Bell
          WiKi: https://wiki.fogproject.org/wiki/index.php/Main_Page

          Wayne WorkmanW 1 Reply Last reply Reply Quote 0
          • Wayne WorkmanW
            Wayne Workman @Raymond Bell
            last edited by Wayne Workman

            @Raymond-Bell

            I just did it on my fog server. This is how it’s done:

            mysql
            use fog
            update hosts set hostLastDeploy = '';
            

            That’s not a double quotation at the end, its two single quotes lol. ‘’ 🙂

            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!
            Daily Clean Installation Results:
            https://fogtesting.fogproject.us/
            FOG Reporting:
            https://fog-external-reporting-results.fogproject.us/

            1 Reply Last reply Reply Quote 0
            • Raymond BellR
              Raymond Bell Testers
              last edited by

              @Wayne-Workman getting error

              mysql> use fog
              Database changed
              mysql> update hosts set hostLastDeploy = '';
              Query OK, 1 row affected, 807 warnings (0.02 sec)
              Rows matched: 807  Changed: 1  Warnings: 807
              

              Raymond Bell
              WiKi: https://wiki.fogproject.org/wiki/index.php/Main_Page

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

                The hostLastDeploy column is expecting a date. Maybe it’d be better as:

                UPDATE fog.hosts SET hostLastDeploy='0000-00-00 00:00:00';

                However, I’d like to note that this does not clear the history table. The more proper method would be to run:

                truncate table fog.history;

                If you’re trying to clear the imaging log you could run:
                truncate table fog.imagingLog;

                If you’re trying to clear the actual tasking table you could run:
                truncate table fog.tasks;

                I would not recommend clearing the imaging logs though as that’s where the “history” sits. This is how it knows what tasks have been run and how it knows what to display on the dashboard in the 30 day history status. Of course you can do as you please.

                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 2
                • Raymond BellR
                  Raymond Bell Testers
                  last edited by

                  @Tom-Elliott I will leave was just going to try to clean up DB because it is like 96Mb

                  Raymond Bell
                  WiKi: https://wiki.fogproject.org/wiki/index.php/Main_Page

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

                  169

                  Online

                  12.0k

                  Users

                  17.3k

                  Topics

                  155.2k

                  Posts
                  Copyright © 2012-2024 FOG Project