Created
May 17, 2020 21:56
-
-
Save nalexn/8a7cbd2ea64535c3ee0798ec31c0732b to your computer and use it in GitHub Desktop.
Setting up rsync with LaunchAgent
This file contains hidden or 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>com.rsync.backup</string> | |
<key>ProgramArguments</key> | |
<array> | |
<string>open</string> | |
<string>-a</string> | |
<string>/Users/me/scripts/rsync_run.app</string> | |
</array> | |
<key>StartInterval</key> | |
<integer>300</integer> | |
</dict> | |
</plist> |
This file contains hidden or 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
#!/usr/bin/env sh | |
# Path to the backup destination directory: | |
backup_dest="/Users/me/Library/.../Backups/backup" | |
# Check if the cloud storage is mounted: | |
if [ -d "$backup_dest" ] | |
then | |
# Start the backup: | |
rsync -abuv --delete --no-l --backup-dir="backup_$(date +%Y-%m-%d_%H-%M-%S)" --exclude-from="/Users/me/scripts/rsync_exclude.txt" "/Users/me/Documents/MyActiveProject" "$backup_dest" | |
fi |
This file contains hidden or 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
# Development | |
- Carthage | |
- Pods | |
- xcuserdata | |
- .DS_Store | |
- .git | |
- .ipa | |
- .dSYM.zip | |
- .dSYM |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment