Last active
November 28, 2024 20:04
-
-
Save uotw/a1ea77b7a3f155f81c1e4ed25b8e19a5 to your computer and use it in GitHub Desktop.
MacOS bash script to periodically sync two folders of FIT files
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 bash | |
# Check if two arguments (source and destination folders) are provided | |
if [ "$#" -ne 2 ]; then | |
echo "Usage: $0 <source_directory> <destination_directory>" | |
exit 1 | |
fi | |
while true | |
do | |
# Rsync command to sync .fit files | |
rsync -azP --include='*.fit' --exclude='*' "$1" "$2" | |
# Feedback messages | |
echo "*************" | |
echo "Sleeping..." | |
echo "*************" | |
sleep 150 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This script was written to keep a remote ASI AIR folder in sync with a local Mac folder. It checks every 2.5 minutes for changes, only moving FIT files.
Installation
cd <localfolder>
mkdir ASIAIR
Usage
cd <localfolder>
mount_smbfs //[email protected]/TF%20Images/ ASIAIR/
./keepsync.sh ASIAIR/<from folder>/ <to folder>/
More details
./keepsync.sh ASIAIR/Autorun/Light/M42/ M42/Lights/
ls ASIAIR/Autorun/Light/