grouper-users - RE: [grouper-users] Disable loader jobs
Subject: Grouper Users - Open Discussion List
List archive
- From: "Hyzer, Chris" <>
- To: Andrew Morgan <>, "" <>
- Subject: RE: [grouper-users] Disable loader jobs
- Date: Fri, 20 Apr 2018 08:59:58 +0000
- Accept-language: en-US
- Authentication-results: orst.edu; dkim=none (message not signed) header.d=none;orst.edu; dmarc=none action=none header.from=isc.upenn.edu;
- Ironport-phdr: 9a23:TlcZ6RCEk1/AAgt+Q9HpUyQJP3N1i/DPJgcQr6AfoPdwSP37osqwAkXT6L1XgUPTWs2DsrQY07GQ6/iocFdDyK7JiGoFfp1IWk1NouQttCtkPvS4D1bmJuXhdS0wEZcKflZk+3amLRodQ56mNBXdrXKo8DEdBAj0OxZrKeTpAI7SiNm82/yv95HJbAhEmDSwbaluIBmqsA7cqtQYjYx+J6gr1xDHuGFIe+NYxWNpIVKcgRPx7dqu8ZBg7ipdpesv+9ZPXqvmcas4S6dYDCk9PGAu+MLrrxjDQhCR6XYaT24bjwBHAwnB7BH9Q5fxri73vfdz1SWGIcH7S60/VC+85Kl3VhDnlCYHNyY48G7JjMxwkLlbqw+lqxBm3oLYfJ2ZOP94c6jAf90VWHBBU95RWSJfH428c4UBAekPPelaronyu1QAohSlCAmwHePj1iNEimPq0aEk1ekqDAHI3BYnH9ILqHnYotf7NacTUO+r1qnE1SjIYu1W2Tfn6YjIaR4tquyLULJ1bcXRyUkuFgLbgVWKsoHlPiiV2fgXv2iG9+pvS+Svi2g9pw5vvzev294hh4/UjYwbzVDE8D92wIczJdCgSU57Z8KkH4VKtyGcKYR2Xt0uT3t2tykn170Lv4OwcisSyJk/2RLQceCLf5WN7x7+SeqdPDJ1hHxqdb6jmxq/9EqtxfPzW8S11VtHqzRJnsXMu3wVyhDe5NSLRuF580u8wzqDyR3f5+VeLUwpl6fWKoYtwrAumZcQrUjOGyr7l1vrgKCMckgp/+al5/rmb7r8o5KRNJJ4ig/7P6gwhsCwHfo0Pw4TVGaB4+u8zqfs/UjhTbVKkPI2lq7ZvYjCK8kHoaC1HxFZ3p8+5hi5ETuqydMYkmIZI15ffxKHkpTpNErJIPDlC/ewnk6gkC9xx/DBIr3uHInCLmTCkLfme7Zx8UlcyBcvzdBb4JJUDbIBLOjvVU/2sdzUFh45MwqqzOb7ENhxyJkRVX6SDqKcLa/erEKE6+chI+SDeIMZpDPwJvo76PPhjHI0nFoQcbe10ZYXcHy4G+5pI0SdYXrimNcBFmIKsxI7TOP2iF2DUT9SaGioX68n5zE7E56pAZ3eRoC1nrOB2iG7EodIaW9bF1CACW3oeJmcW/cQdCKSJddskjMeVbimVo8hzQ+htBXjx7p6Nerb5DcYtYn42dhx5u3Tjg0y9SdqA8iH0mGNSX10kX0SRz8wwq9/vVJxxk2d3qdlnvwLXeBUstpPXh03Ktb5yPZ1Ata6DgfGZNiATn6hWM66Rzw9U4R1i5UBeUFgA9i4yw3Y0jCxK74Ti7GRApEoqOTR02W7b5Jy0XHbzKQ7ykQ9T9FUHWygmqNl8QXPXcjEn1jPxIiwcqFJlg7c5mqZiSKlvFtZS0Q4BaDOXWENa1H+rM/yoF7aQrmoT7krL10Smoa5NqJWZ4ix3h19T/D5NYGbOjrplg==
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
I added a jira for an enabled/disabled flag on loader jobs:
https://bugs.internet2.edu/jira/browse/GRP-1736
Thanks Chad and Carl for your responses. I made a GSH which generates GSH
for this and put it on the wiki:
https://spaces.internet2.edu/pages/viewpage.action?pageId=14517859
###################### If you run this:
grouperSession = GrouperSession.startRootSession();
sqlLoaderDefName =
AttributeDefNameFinder.findByName("etc:legacy:attribute:legacyGroupType_grouperLoader",
true);
sqlLoaderDefScheduleName =
AttributeDefNameFinder.findByName("etc:legacy:attribute:legacyAttribute_grouperLoaderQuartzCron",
true);
ldapLoaderDefName =
AttributeDefNameFinder.findByName("etc:attribute:loaderLdap:grouperLoaderLdap",
true);
ldapLoaderDefScheduleName =
AttributeDefNameFinder.findByName("etc:attribute:loaderLdap:grouperLoaderLdapQuartzCron",
true);
StringBuilder result = new StringBuilder();
result.append("\n\n############ RESTORE OLD SCHEDULES, BOUNCE GROUPER
DAEMONS AFTERWARDS #############\n\ngrouperSession =
GrouperSession.startRootSession();\n");
result.append("sqlLoaderDefName =
AttributeDefNameFinder.findByName(\"etc:legacy:attribute:legacyGroupType_grouperLoader\",
true);\n");
result.append("sqlLoaderDefScheduleName =
AttributeDefNameFinder.findByName(\"etc:legacy:attribute:legacyAttribute_grouperLoaderQuartzCron\",
true);\n");
result.append("ldapLoaderDefName =
AttributeDefNameFinder.findByName(\"etc:attribute:loaderLdap:grouperLoaderLdap\",
true);\n");
result.append("ldapLoaderDefScheduleName =
AttributeDefNameFinder.findByName(\"etc:attribute:loaderLdap:grouperLoaderLdapQuartzCron\",
true);\n");
attributeAssigns =
GrouperDAOFactory.getFactory().getAttributeAssign().findAttributeAssignments(AttributeAssignType.group,
null, sqlLoaderDefName.getId(), null, null, null, null, null, true, false);
for (AttributeAssign attributeAssign : attributeAssigns)
{result.append("group = GroupFinder.findByName(grouperSession, \"" +
attributeAssign.getOwnerGroup().getName() + "\");\nattributeAssignOnAssign =
group.getAttributeDelegate().retrieveAssignment(null, sqlLoaderDefName,
false,
false);\nattributeAssignOnAssign.getAttributeValueDelegate().assignValueString(\""
+ sqlLoaderDefScheduleName.getName() + "\", \"" +
attributeAssign.getAttributeValueDelegate().retrieveValueString(sqlLoaderDefScheduleName.getName())
+ "\");\n"); }
attributeAssigns =
GrouperDAOFactory.getFactory().getAttributeAssign().findAttributeAssignments(AttributeAssignType.group,
null, ldapLoaderDefName.getId(), null, null, null, null, null, true, false);
for (AttributeAssign attributeAssign : attributeAssigns)
{result.append("group = GroupFinder.findByName(grouperSession, \"" +
attributeAssign.getOwnerGroup().getName() + "\");\nattributeAssignOnAssign =
group.getAttributeDelegate().retrieveAssignment(null, ldapLoaderDefName,
false,
false);\nattributeAssignOnAssign.getAttributeValueDelegate().assignValueString(\""
+ ldapLoaderDefScheduleName.getName() + "\", \"" +
attributeAssign.getAttributeValueDelegate().retrieveValueString(ldapLoaderDefScheduleName.getName())
+ "\");\n"); }
result.append("\n\n############ DISABLE ALL SCHEDULES, BOUNCE GROUPER
DAEMONS AFTERWARDS #############\n\ngrouperSession =
GrouperSession.startRootSession();\n");
result.append("sqlLoaderDefName =
AttributeDefNameFinder.findByName(\"etc:legacy:attribute:legacyGroupType_grouperLoader\",
true);\n");
result.append("sqlLoaderDefScheduleName =
AttributeDefNameFinder.findByName(\"etc:legacy:attribute:legacyAttribute_grouperLoaderQuartzCron\",
true);\n");
result.append("ldapLoaderDefName =
AttributeDefNameFinder.findByName(\"etc:attribute:loaderLdap:grouperLoaderLdap\",
true);\n");
result.append("ldapLoaderDefScheduleName =
AttributeDefNameFinder.findByName(\"etc:attribute:loaderLdap:grouperLoaderLdapQuartzCron\",
true);\n");
attributeAssigns =
GrouperDAOFactory.getFactory().getAttributeAssign().findAttributeAssignments(AttributeAssignType.group,
null, sqlLoaderDefName.getId(), null, null, null, null, null, true, false);
for (AttributeAssign attributeAssign : attributeAssigns)
{result.append("group = GroupFinder.findByName(grouperSession, \"" +
attributeAssign.getOwnerGroup().getName() + "\");\nattributeAssignOnAssign =
group.getAttributeDelegate().retrieveAssignment(null, sqlLoaderDefName,
false,
false);\nattributeAssignOnAssign.getAttributeValueDelegate().assignValueString(\""
+ sqlLoaderDefScheduleName.getName() + "\", \"0 0 0 1 1 ? 3000\");\n"); }
attributeAssigns =
GrouperDAOFactory.getFactory().getAttributeAssign().findAttributeAssignments(AttributeAssignType.group,
null, ldapLoaderDefName.getId(), null, null, null, null, null, true, false);
for (AttributeAssign attributeAssign : attributeAssigns)
{result.append("group = GroupFinder.findByName(grouperSession, \"" +
attributeAssign.getOwnerGroup().getName() + "\");\nattributeAssignOnAssign =
group.getAttributeDelegate().retrieveAssignment(null, ldapLoaderDefName,
false,
false);\nattributeAssignOnAssign.getAttributeValueDelegate().assignValueString(\""
+ ldapLoaderDefScheduleName.getName() + "\", \"0 0 0 1 1 ? 3000\");\n"); }
System.out.println(result);
################## It will generate something like this
[appadmin@i2midev6 bin]$ ./gsh disableLoaders.gsh
############ RESTORE OLD SCHEDULES, BOUNCE GROUPER DAEMONS AFTERWARDS
#############
grouperSession = GrouperSession.startRootSession();
sqlLoaderDefName =
AttributeDefNameFinder.findByName("etc:legacy:attribute:legacyGroupType_grouperLoader",
true);
sqlLoaderDefScheduleName =
AttributeDefNameFinder.findByName("etc:legacy:attribute:legacyAttribute_grouperLoaderQuartzCron",
true);
ldapLoaderDefName =
AttributeDefNameFinder.findByName("etc:attribute:loaderLdap:grouperLoaderLdap",
true);
ldapLoaderDefScheduleName =
AttributeDefNameFinder.findByName("etc:attribute:loaderLdap:grouperLoaderLdapQuartzCron",
true);
group = GroupFinder.findByName(grouperSession,
"nyu_apereo:presenter:allStevens3");
attributeAssignOnAssign =
group.getAttributeDelegate().retrieveAssignment(null, sqlLoaderDefName,
false, false);
attributeAssignOnAssign.getAttributeValueDelegate().assignValueString("etc:legacy:attribute:legacyAttribute_grouperLoaderQuartzCron",
"0 0 * * * ?");
group = GroupFinder.findByName(grouperSession,
"test:loader:testLdapGroupList");
attributeAssignOnAssign =
group.getAttributeDelegate().retrieveAssignment(null, ldapLoaderDefName,
false, false);
attributeAssignOnAssign.getAttributeValueDelegate().assignValueString("etc:attribute:loaderLdap:grouperLoaderLdapQuartzCron",
"0 0 * * * ?");
############ DISABLE ALL SCHEDULES, BOUNCE GROUPER DAEMONS AFTERWARDS
#############
grouperSession = GrouperSession.startRootSession();
sqlLoaderDefName =
AttributeDefNameFinder.findByName("etc:legacy:attribute:legacyGroupType_grouperLoader",
true);
sqlLoaderDefScheduleName =
AttributeDefNameFinder.findByName("etc:legacy:attribute:legacyAttribute_grouperLoaderQuartzCron",
true);
ldapLoaderDefName =
AttributeDefNameFinder.findByName("etc:attribute:loaderLdap:grouperLoaderLdap",
true);
ldapLoaderDefScheduleName =
AttributeDefNameFinder.findByName("etc:attribute:loaderLdap:grouperLoaderLdapQuartzCron",
true);
group = GroupFinder.findByName(grouperSession,
"nyu_apereo:presenter:allStevens3");
attributeAssignOnAssign =
group.getAttributeDelegate().retrieveAssignment(null, sqlLoaderDefName,
false, false);
attributeAssignOnAssign.getAttributeValueDelegate().assignValueString("etc:legacy:attribute:legacyAttribute_grouperLoaderQuartzCron",
"0 0 0 1 1 ? 3000");
group = GroupFinder.findByName(grouperSession,
"test:loader:testLdapGroupList");
attributeAssignOnAssign =
group.getAttributeDelegate().retrieveAssignment(null, ldapLoaderDefName,
false, false);
attributeAssignOnAssign.getAttributeValueDelegate().assignValueString("etc:attribute:loaderLdap:grouperLoaderLdapQuartzCron",
"0 0 0 1 1 ? 3000");
-----Original Message-----
From:
[mailto:]
On Behalf Of Andrew Morgan
Sent: Wednesday, April 18, 2018 6:57 PM
To:
Subject: [grouper-users] Disable loader jobs
Is there an easy way to disable loader jobs?
Our Banner team is going to re-stage tables in our ODS this weekend, and
these tables drive views for many Grouper loader jobs. For safety, I want
to disable the loader jobs while this is happening. However, I need other
Grouper changes to continue to be processed, such as updates out to AD and
LDAP from the PSP (changelog consumers).
I know I can modify the cron schedule for each loader job, but that gets a
little tedious to do through the UI for 40 or so loader jobs.
Is there any GSH to list all loader jobs? A GSH way to dump the existing
schedule to the screen and set the schedule to a new value?
Thanks!
Andy Morgan
Systems Administrator, Identity & Access Management
Information Services | Oregon State University
541-737-8877 | is.oregonstate.edu
- [grouper-users] Disable loader jobs, Andrew Morgan, 04/18/2018
- RE: [grouper-users] Disable loader jobs, Redman, Chad, 04/19/2018
- Re: [grouper-users] Disable loader jobs, Carl Waldbieser, 04/19/2018
- RE: [grouper-users] Disable loader jobs, Hyzer, Chris, 04/20/2018
- RE: [grouper-users] Disable loader jobs, Andrew Morgan, 04/20/2018
- RE: [grouper-users] Disable loader jobs, Black, Carey M., 04/20/2018
- Re: [grouper-users] Disable loader jobs, Shilen Patel, 04/20/2018
- RE: [grouper-users] Disable loader jobs, Hyzer, Chris, 04/20/2018
- RE: [grouper-users] Disable loader jobs, Andrew Morgan, 04/20/2018
- RE: [grouper-users] Disable loader jobs, Hyzer, Chris, 04/20/2018
- RE: [grouper-users] Disable loader jobs, Andrew Morgan, 04/20/2018
Archive powered by MHonArc 2.6.19.