Copy files

monaronyc
Contributor

Hi Group!

Not sure if this is something we can do with Casper or if we need some kind of scripting help, but we'd like to be able copy certain files at startup or login from a share on our network, to 2 places on the local machine:

/Users/[Username]/Library/Application Support/Microsoft/Office/User Templates/My Templates
/Applications/Microsoft Office 2011/Office/Startup/Word

So essentially the idea here is to have the local machine check or reach out to this share every time a user logs in.
Anyone doing anything similar they can share? thanks a bunch!

8 REPLIES 8

RobertHammen
Valued Contributor II

You could create a DMG that has the files, and a policy that runs on the login trigger to install the policy, FEU (Fill Existing Users). But this seems a bit like overkill, to do this at every login... and it's going to populate every user folder on the machine, which in a lab environment might take awhile if there are tens/hundreds of users on a system (guess this depends on file size)...

How often do you anticipate these files changing? Maybe you can run the policies only when files change?

bentoms
Release Candidate Programs Tester

@monaronyc, You could have both as separate DMG's & set to install at login via a policy from the JSS & offline.

But this is really heavy.

Instead, I'd advise installing each via a policy scoped to a smart group that is set to "Does Not Have <dmg name> installed by Casper"

Then when v2 comes out, swap the DMG out in the policy & amend the smart groups.

monaronyc
Contributor

Okay great! This is good! And yes, I should have mentioned its not to all machines. Just a select few. 20 at the most.

@bentoms Where would we start with smart groups?

davidacland
Honored Contributor II

Hi @monaronyc, for a smart group you just set the criteria as Ben mentioned:

"Does Not Have <dmg name> installed by Casper"

Copying files isn't really one of casper's strong points at the moment. It can be achieved by creating a DMG package etc, but is convoluted at best.

Copying files around is something the JAMF binary could easily handle and would be great to see in future versions of the JSS.

adamcodega
Valued Contributor

If your files update once a month or quarterly, a pkg check is worth doing. CorpName-2015-q1.pkg for example.

Otherwise if its weekly or daily, would be be crazy to put rsync on the computers?

Look
Valued Contributor III

Not quite sure how it would behave (only testing would tell) but what if you mounted it as a read only share and then linked to the files on the share...
Would only work when your on the network of course...
Somethine like

mkdir /Volumes/someshare
mount -o nobrowse -t smbfs //someshare /Volumes/someshare
ln -s /Volumes/someshare/somefile /Somelocallocation/somefile

Mayeb with some logic wrapped around to check it doesn't already exist etc... Once the links are made they should persist so it's the sharemount that would need to occur every time, create a launch agent to call the script that does it.

Look
Valued Contributor III

Just to clarify the -o nobrowse is to make it invisible to the GUI the read only would come from the share permissions

Chris_Hafner
Valued Contributor II

Yes, this is something that the Casper suite is really good at. Good enough that you have many many ways of accomplishing what you're asking. I would probably package those files using composer and then use a blank receipt to track changes for compliance/future update.

@RobertHamman and @adamcodega][/url have good questions regarding the necessary frequency of such a task. Scripting these sorts of things manually can get somewhat complex the more logic you try to add to the process. You'll have to be the judge of your own abilities there. I prefer not to script anything unless I really have to, though there are plenty off reasons to do so. That said, this is a pretty simply task regardless of the specific solution.

P.S> I'll second the direct question regarding the desire to load these templates on every login.