Created
April 28, 2011 11:40
-
-
Save brainsatwork/946192 to your computer and use it in GitHub Desktop.
Mac Synchronisation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>org.brainsatwork.sync</string> | |
<key>ProgramArguments</key> | |
<array> | |
<string>~/.sync/sync.sh</string> | |
</array> | |
<key>RunAtLoad</key> | |
<true/> | |
<key>StandardErrorPath</key> | |
<string>~/.sync/error.log</string> | |
<key>StandardOutPath</key> | |
<string>~/.sync/sync.log</string> | |
<key>StartInterval</key> | |
<integer>600</integer> | |
</dict> | |
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#check if ssh connection is available | |
ssh [email protected] exit | |
if [ `echo $?` = "0" ]; then | |
rsync -auq --exclude '.*' /yourLocalFolderPath/ targetMacName.local:/yourTargetFolderPath/ | |
rsync -auq --exclude '.*' targetMacName.local:/ourTargetFolderPath/ /yourLocalFolderPath/ | |
else | |
#echo `date` no connection >> ~/.bawsync/sync.log | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#check if ssh connection is available | |
ssh [email protected] exit | |
if [ `echo $?` = "0" ]; then | |
rsync -auvv --exclude '.*' /yourLocalFolderPath/ targetMacName.local:/yourTargetFolderPath/ >> /.bawsync/sync.log | |
rsync -auvv --exclude '.*' targetMacName.local:/ourTargetFolderPath/ /yourLocalFolderPath/ >> /.bawsync/sync.log | |
else | |
echo `date` no connection >> ~/.bawsync/error.log | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment