Clear Image History From All Host
-
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
-
maybe truncate the history table, or the tasks table.
-
@Wayne-Workman would it be like this
mysql -u root <-p password> fog truncate table history; exit;```
-
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. ‘’
-
@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
-
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.
-
@Tom-Elliott I will leave was just going to try to clean up DB because it is like 96Mb