grouper-users - RE: [grouper-users] Disable loader jobs
Subject: Grouper Users - Open Discussion List
List archive
- From: "Hyzer, Chris" <>
- To: Shilen Patel <>, Andrew Morgan <>
- Cc: "" <>
- Subject: RE: [grouper-users] Disable loader jobs
- Date: Fri, 20 Apr 2018 19:32:59 +0000
- Accept-language: en-US
- Authentication-results: duke.edu; dkim=none (message not signed) header.d=none;duke.edu; dmarc=none action=none header.from=isc.upenn.edu;
- Ironport-phdr: 9a23:TUTA3Bb3jKteKs4mkfDJkgb/LSx+4OfEezUN459isYplN5qZps2+bR7h7PlgxGXEQZ/co6odzbaO6Oa4ASQp2tWoiDg6aptCVhsI2409vjcLJ4q7M3D9N+PgdCcgHc5PBxdP9nC/NlVJSo6lPwWB6nK94iQPFRrhKAF7Ovr6GpLIj8Swyuu+54Dfbx9HiTahb75+Ngm6oRnMvcQKnIVuLbo8xAHUqXVSYeRWwm1oJVOXnxni48q74YBu/SdNtf8/7sBMSar1cbg2QrxeFzQmLns65Nb3uhnZTAuA/WUTX2MLmRdVGQfF7RX6XpDssivms+d2xSeXMdHqQb0yRD+v9LlgRgP2hygbNj456GDXhdJ2jKJHuxKquhhzz5fJbI2JKPZye6XQds4YS2VcRMZcTyxPDJ2hYYsTAeQPPuhYoIv8p1QSohSzHhOjCP/zxjJSmnP6wa833uI8Gg/GxgwgGNcOvWzaoNv3NKYTUP66zLPQwT7ecf5W2S396InTchwvvPqBWrdwftbRyUgvFgLKkE+QpJfkPzOOyusBqXWb7/J+WuKpjW4rsR9+rSWyxso1jITCm4wbylfB9SpjwYY1I8W1SEFhYd68CZdcqTyVO5Z0T84sQmxkoCc6yrsauZGlZigKzoooxwLBZ/CdbYeH/w/jWP6JITdig3Jlf7y/hw618UihzO38StO430pNripAitXMqHEN2ALd68ifUPR98Vmu1SyV2A/P9uFEIEc0lazCJ5MvzL4wjoAcsUvdES/3hUr6laGbeVg59uWn6+nrf7frq5ycOoJwjAz1L6cgmtSnDOgmKAcCQ3WX9OGh2LH+4EH0RbtKg/IqnqXFtZ3XJ9oUq6G9DgJQ14sv9QqzAje+3NgFk3QLMEhJdRaag4TzJV3CPfT1Ae2ij1mukTpn3/7GMaPiD5nRK3XOlanucatn5ENYzQc+w85T6pNOBbwEI///R0HxudnGAhMlLwO43eDqA8hn2IwEQ2KAGKqZPbvSsVCW4uIvJPGBapcJtTj6N/Qo6efig3E+l1ITZKWp2oAYZ26iEvRhPkWZfWHjgtAcEWcMowUyVvTqiEeFUT5PeXm9Q7485jA8CIKgF4vDQZ2tgKCF3Ce8GZ1WZXpKBUyLEXftb4mEWvEMZzyOIsJ5jDALT6StR5Ik2B2zqQP21r9qLuTb9yEEqZ7u0dp46PPcmBw28DF5CtqR332NQm1sm2MHXT423KRxoUxnzVeD1LB1g/lEGtxT5/JIUxk1NYTHwux7END9RhjNfsqRSFm4RNWmBys9QcwszN8Te0p9Acmtjgjf3yq2BL8Yj7OLBIYz8qLBx3j+Odx9x2/b1Kk6kVYmWNBPOHaihq5+7AjTG5XJn1uDm6arc6QcwDDC9H2FzWWQoEFUThR8XrvYUnACNQPqqoHC5kLGQrnmMb07Pw8JndWCK69HbPXlkFZLAvrvJYKaK0u3l329Gl6twamDZYyiL2AaxirUDmADiRsPu3uKKF5tKD2mpjeULC18GEirK2js6+hl4jvvS0Q03hOHdWVgzLHz5wYYg/raRv8OiOFX8Bw9oil5SQ7ul+ndDMCN8k84JP1R
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
Sorry that script worked in legacy gsh… but with patch like shilen said should work in new gsh… if you get it working let me know the script and I can update the wiki Thanks Chris From: Shilen Patel [mailto:]
I believe this was fixed in patch #83 (https://bugs.internet2.edu/jira/browse/GRP-1625) which was a fix to allow typed variables. The alternative is to not use typed variables.
E.g. groovy:000> result = new StringBuilder(); ===> groovy:000> result.append("test\n"); ===> test groovy:000> - Shilen On 4/20/18, 2:54 PM, "" <> wrote: I'm running into something which must be simple: # ./gsh Using GROUPER_HOME: /private/grouper/api/bin/.. Using GROUPER_CONF: /private/grouper/api/bin/../conf Using JAVA: /usr/local/java/bin/java using MEMORY: 64m-1536m Grouper starting up: version: 2.3.0, build date: null, env: DEV grouper.properties read from: /private/grouper/api/conf/grouper.properties Grouper current directory is: /private/grouper/api/bin log4j.properties read from: /private/grouper/api/conf/log4j.properties Grouper logs are not using log4j: class org.apache.commons.logging.impl.SLF4JLocationAwareLog grouper.hibernate.properties: /private/grouper/api/conf/grouper.hibernate.properties grouper.hibernate.properties: <redacted> subject.properties read from: /private/grouper/api/conf/subject.properties sources configured in: subject.properties subject.properties ldap source id: ldap: ldap.properties subject.properties groupersource id: g:gsa subject.properties groupersource id: grouperEntities Type help() for instructions Groovy Shell (2.4.11, JVM: 1.8.0_121) Type ':help' or ':h' for help. ----------------------------------------------------------------------------------------------------------------------------------------------------------------- groovy:000> :load /private/grouper/api/conf/groovysh.profile groovy:000> grouperSession = GrouperSession.startRootSession(); ===> c97020b6c5944668848073a3e9ac9c58,'GrouperSystem','application' groovy:000> StringBuilder result = new StringBuilder(); ===> groovy:000> result.append("test\n"); Unknown property: result It seems like StringBuilder isn't working?? Thanks, Andy On Fri, 20 Apr 2018, Hyzer, Chris wrote: > I added a jira for an enabled/disabled flag on loader jobs: > > > Thanks Chad and Carl for your responses. I made a GSH which generates GSH for this and put it on the wiki: > > > ###################### 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: [] 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.