Script auditing: I want to find out which K1000 scripts are no longer being used
We have over 400 scripts in our K1000, and I would like to be able to run an audit of some sort to determine which scripts are no longer being used so I can remove them. I found in Settings > History > Reporting > Objects than I can perform an advanced search for "Run Now" to get a list of scripts that have been run but I think the results only show those that were manually run, not scheduled. Without having to open each script individually, how can I find out which scripts are also scheduled to run automatically?
0 Comments
[ - ] Hide Comments
Answer this question
or Comment on this question for clarity
Answers
I came up with this query:
SELECT KBOT.ID, KBOT.NAME, KBOT.MODIFIED, MAX(LOG.TIMESTAMP) as "Latest Start",
CONCAT_WS(" ", CRON.MINUTES, CRON.HOURS, CRON.DAYS_OF_MONTH, CRON.MONTHS, CRON.DAYS_OF_WEEK) as "Cron Schedule",
GROUP_CONCAT(MACHINE.NAME) as "Machines"
FROM KBOT
LEFT JOIN KBOT_LOG_LATEST LOG on LOG.KBOT_ID = KBOT.ID
LEFT JOIN KBOT_CRON_SCHEDULE CRON on CRON.KBOT_ID = KBOT.ID
LEFT JOIN MACHINE on MACHINE.ID = LOG.MACHINE_ID
GROUP BY KBOT.ID
This should return the following information for every script:
ID
Name
Last Modified Date
Latest start time according to the KBOT_LOG_LATEST table
Cron Schedule (if there is one)
The machines the script has run on according to the KBOT_LOG_LATEST table.
Please log in to comment
Please log in to comment
Comments