![]() |
I'd probably go with the wildcard one-liner if you don't need any special exclusion or logging. Since you're actually sitting at the unit when you do this--which I now know--logging probably isn't going to gain you anything with something this simple. If you need to wrap it in a shell script for Casper to use it, this is really all you need:
Code:
#!/bin/sh |
And as a side note, when the targets exist in none of the folders matched by the wildcard, either in the one-liner or the wrapped version, rm will spit out a "No such file or directory" error and exit 1. You can do what you want with this, suppress it if you like, whatever.
|
Hey thanks guys. The end users never see this stuff run, its all via ssh in the background under the hood. They only thing they see is a dialog box that says you need to restart your computer it has been updated, click OK to restart and save all current data, blah blah blah
Casper has its own binary as well, which I can use (and I am still learning) and it will use the under the hood unix in OS X to accomplish a task. For example, we have as of right now 8 or so different images, and each image is the same except for passwords, which are subnet specific. So, I knew that having 8 versions of the same image may have been the working solution before i was hired on and there were other higher priority things to get done so it got put on the back burner. Well, I just updated the image, and reset all the passwords to some basic generic ones in the image, then wrote a casper script using casper's binary to set the specific passwords for the admin accounts and for the firmware. Now, these scripts are in plain text and sit on AFP shares on OS X servers. The owner and the only user that can access these files is the hidden local admin account for casper, which is not the same local admin account for local administration. Then that information gets pulled from the server via ssh, encrypted and all from a very secure AFP share to the client machine and the passwords are automatically set. This is really awesome. I can even set up a policy so if you change subnets, your passwords change too for the administration side. That way, depending on which subnet you are on depends on which admin you see for help since we are split up into different buildings and each one is on its own subnet. That way each admin doesn't have to remember 8 sets of unique passwords for the local admin and the firmware, while only I know the casper account password. That is the most secure way I have come up with to deploy passwords and house 1 generic image for 5,000 laptops over 6 different subnets. Only achievable by casper (I know shameless plug - you almost think I am working for them). This also creates a very simplistic netboot - reimage process. You reimage several macbooks at once via netboot and part of the post script image policy is that it will push out those password settings, so the IT person doesn't have to touch it. You can also let fewer people know the passwords since fewer people will need to touch it since you are already more efficient. I need to start a blog of what I am doing, some really cool stuff I am doing and able to do now with our infrastructure and if it were maybe documented better I think Apple could get that kick over into the enterprise environment and then maybe Jobs will finally say, they are in fact an enterprise company. |
Quote:
How about you? ;) sudo ls -ld /Users/*/Library/Application\ Support -it can't "expand" below each user's ~/Library. -it needs to see full paths, not just usernames. |
Quote:
What I said about the /Users folder being world-accessible was correct but I didn't think about the sub-folders that followed the *. The Library sub-folder in each user's home is not readable unless you are 'root'. So, you are quite right that the wildcarding won't work in that case. |
It will work if it's part of a shell script, though, whether via sudo or actually running from a root shell. (I tested the script above with ls instead of rm and it worked just fine.)
|
| All times are GMT -5. The time now is 05:42 PM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.