Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save talkingmoose/d09210f9dced9daebae8121e743d90f6 to your computer and use it in GitHub Desktop.
Save talkingmoose/d09210f9dced9daebae8121e743d90f6 to your computer and use it in GitHub Desktop.

STEP 1

Generate a key pair on your Master distribution point (DP) that the script will use for authentication to each of your remote DPs, by running the following command in Terminal (copy/paste).

/usr/bin/ssh-keygen -q -t rsa -f "$HOME/.ssh/jamfMasterDP" -N ""  

This will create your private key and public key files in your home folder:

~/.ssh/jamfMasterDP  
~/.ssh/jamfMasterDP.pub

STEP 2

Use the ssh-copy-id command/script (built in to macOS 10.12 Sierra) to copy your public key (jamfMaster.pub) to each of your remote DPs. This requires you have Remote Login (SSH) enabled on your remote servers.

/usr/bin/ssh-copy-id -i $HOME/.ssh/jamfMasterDP admin@remotedp.server.com

Replace admin in the command with an admin account for the remote DP.

Replace remotedp.server.com in the command with the FQDN or IP address of the remote DP.

Enter your password for the remote server when prompted.

Repeat this step for each of your remote DPs.

STEP 3

Run this command (one line) manually in Terminal for each of your remote DPs:

/usr/bin/rsync --archive --human-readable --verbose -e "ssh -i $HOME/.ssh/jamfMasterDP" --delete --progress --stats /local/path/to/Packages/ admin@remotedep.server.com:/remote/path/to/Packages/

Replace /local/path/to/Packages in the command with the full path to your Packages folder on your Master DP.

Replace admin in the command with an admin account for the remote DP.

Replace remotedp.server.com in the command with the FQDN or IP address of the remote DP.

Replace /remote/path/to/packages/ in the command with the full path to your Packages folder on your Remote DP. It should look something like "/Users/Shared/CasperDP/Packages/".

Repeat this step for each of your remote DPs.

On your remote DPs, locate the Packages folder and verify the installer packages match your Master DP. As you add items to your Master DP or remove items from it, run the rsync command again. It will match the contents of your remote DPs to that of your Master DP.

You should see output in Terminal that looks similar to this:

building file list ... 
157 files to consider
./
file 1.pkg
      65.23K 100%   30.96MB/s    0:00:00 (xfer#1, to-check=119/157)
file 2.pkg
       3.32M 100%    6.72MB/s    0:00:00 (xfer#2, to-check=117/157)
file 3.pkg
       2.27K 100%    4.71kB/s    0:00:00 (xfer#3, to-check=80/157)
file 4.dmg
     281.60K 100%  541.34kB/s    0:00:00 (xfer#4, to-check=78/157)
file 5.dmg
      68.28K 100%  125.57kB/s    0:00:00 (xfer#5, to-check=76/157)
file 6.pkg
     191.76K 100%  351.35kB/s    0:00:00 (xfer#6, to-check=74/157)
file 7.dmg
       4.63K 100%    8.48kB/s    0:00:00 (xfer#7, to-check=72/157)
file 8.pkg
      23.54K 100%   43.13kB/s    0:00:00 (xfer#8, to-check=70/157)
 
Number of files: 157
Number of files transferred: 8
Total file size: 21.70M bytes
Total transferred file size: 3.96M bytes
Literal data: 3.96M bytes
Matched data: 0 bytes
File list size: 4329
File list generation time: 0.003 seconds
File list transfer time: 0.000 seconds
Total bytes sent: 3.96M
Total bytes received: 202
 
sent 3.96M bytes  received 202 bytes  2.64M bytes/sec
total size is 21.70M  speedup is 5.48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment