Posted on 09-11-2012 10:46 AM
I ma trying to delete a directory from /Library/Application Support/iLifeMediaBrowser
-Is there a way to accomplish this with jss. Do I need a script? If yet, does anyone have example?
Posted on 09-11-2012 11:16 AM
Simple script will work
#!/bin/sh
rm -R "/yourdirectory"
Upload Script to Casper Admin
Create a Policy
Set the target group
Set your trigger
Posted on 09-11-2012 12:39 PM
not working
i get this error
/usr/sbin/jamf is version 8.6
Executing Policy Run Script iLifeFix.sh...
Creating directory structure for /Library/Application Support/JAMF/Downloads/
Downloading http://zeus.gowerschools.org:80/CasperShare/Scripts/iLifeFix.sh...
Running script iLifeFix.sh...
Script exit code: 2
Script result: /private/tmp/iLifeFix.sh: line 1: {rtf1ansiansicpg1252cocoartf1038cocoasubrtf360: command not found
/private/tmp/iLifeFix.sh: line 2: syntax error near unexpected token `}'
/private/tmp/iLifeFix.sh: line 2: `{fonttblf0fnilfcharset0 Calibri;f1fmodernfcharset0 Courier;}'
My script look like this:
#! /bin/sh
rm -rf "/Volumes/Macintosh_HD/Library/Application Support/iLifeMediaBrowser/"
Posted on 09-11-2012 12:40 PM
Hi Everyone,
You can just run a command in a policy in the advanced tab to use the rm command to remove a directory. So, in the JSS, create a policy and have the policy do nothing, but on the advanced tab there is a run command box. In that box input your command. No script needed.
Just be careful you are doing the right thing as once you scope the policy to production there is no turning back.
Hope that helps,
Tom
Posted on 09-11-2012 12:43 PM
Your shebang is set up wrong if that is how your script actually looks. Should be
#!/bin/sh
You have a space in there.
But to make this easier, use either Casper Remote or a policy with the Run Command field under Advanced with something like-
rm -R /Library/Application Support/iLifeMediaBrowser
For one liners like that there is no need to create and upload a whole script.
Posted on 09-11-2012 12:49 PM
My script look like this: #! /bin/sh rm -rf "/Volumes/Macintosh_HD/Library/Application Support/iLifeMediaBrowser/"
You have a space in your shebang, should be #!/bin/sh or #!/bin/bash
Hope this fixes your problem,
Tom
Posted on 09-12-2012 12:48 PM
Thank You...I used the Run Command in the Advanced options. Works great