Posted on 04-07-2014 05:28 PM
Hey cadmins,
Here's a script that might make your day. If you are sick of manually syncing your CDPs via Casper Admin I suggest you try this out.
syncCDPs.sh
Run it on your main CDP nightly via launchd (OSX only).
- queries the jss for all CDPs (don't configure this script to add or change CDPs - just do it in the JSS).
- rsyncs locally via a fileshare (slower but more compatible).
Sharing the love..
https://interpublic.box.com/s/quqoz45h54v7k1y8ktrj
Your log could look like this..
rsync to cdps started: Tue 8 Apr 2014 07:17:52 EST
getting cdp details from jss...
getting details for ADECDP01 ...
getting details for BNEFPR02 ...
getting details for MEBCDP01 ...
getting details for MEBCDP02 ...
getting details for PERCDP01 ...
getting details for SYD 303 ...
getting details for SYD DRF ...
getting details for SYD MBW ...
getting details for SYDCDP01 ...
local path: /Volumes/Server HD/CasperShare/
starting sync to ADECDP01..
mounting 10.136.20.23/CasperShare via AFP ...
rsyncing to ADECDP01: Tue 8 Apr 2014 07:17:59 EST ...
building file list ... done
sent 471412 bytes received 20 bytes 331.18 bytes/sec
total size is 285552522640 speedup is 605713.07
unmounting /tmp/CasperShare...
starting sync to BNEFPR02..
mounting 10.132.11.18/CasperShare via AFP ...
rsyncing to BNEFPR02: Tue 8 Apr 2014 07:41:44 EST ...
building file list ... done
sent 471412 bytes received 20 bytes 477.88 bytes/sec
total size is 285552522640 speedup is 605713.07
unmounting /tmp/CasperShare...
starting sync to MEBCDP01..
mounting mebcdp01/CasperShare via AFP ...
rsyncing to MEBCDP01: Tue 8 Apr 2014 07:58:13 EST ...
building file list ... done
sent 471412 bytes received 20 bytes 619.08 bytes/sec
total size is 285552522640 speedup is 605713.07
unmounting /tmp/CasperShare...
....... etc ...
And your day could look like this...
Posted on 06-18-2014 01:55 AM
Hey @loceee][/url
I'm trying to work out how you are grabbing the local path to the repository from the JSS?
I see this line
cdplocalpath[$i]=$(xpath "$cdpdata/${cdpname[$i]}.xml" //distribution_point/local_path 2> /dev/null | sed -e 's/<local_path>//g;s/</local_path>//g')
But on my test JSS v9.31 I'm not seeing a value for this attribute.
My master distribution point is the same server as the JSS (Mac OS X Server 10.9)
The repository lives in /Users/Shared/CasperRepo
Just wondering if there is a way to grab this from the JSS or if I should just make ```
masterlocalpath="/Users/Shared/CasperRepo"
```
Posted on 06-18-2014 01:56 AM
BTW awesome script thanks for posting :)
Posted on 06-18-2014 09:14 PM
Hey @calumhunter ... I am gonna assume that I have some old data from a previous version (when it used to sync itself).
Updated script and it's been moved to my github repo https://github.com/loceee/OSXCasperScripts.
Glad it's useful!
Posted on 06-18-2014 11:31 PM
:) happy days thanks mate
Posted on 06-18-2014 11:37 PM
I added -t to the rsync, but you might want to remove that. rsync didn't have luck setting times on some of my shares.
I also might look at changing the excludes... as I might have it sync .htpasswd files as well. I will update the code again soon, just keep an eye on github.