Created
April 12, 2019 13:54
-
-
Save SterlingButters/11c132d757304d4a1262c3453d0d8583 to your computer and use it in GitHub Desktop.
Recursively Syncs oDrive Directories and SubDirectories starting from pwd
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 | |
handle_directory(){ | |
for filename in "$1"/*; do | |
if [[ "$filename" = *.cloud ]]; then | |
echo "File[$filename] not synced" | |
/usr/bin/python /home/sterlingbutters/.odrive-agent/bin/odrive.py sync "$filename" | |
elif [[ "$filename" = *.cloudf ]]; then | |
echo "File[$filename] not synced" | |
/usr/bin/python /home/sterlingbutters/.odrive-agent/bin/odrive.py sync "$filename" | |
elif [ -d "$filename" ]; then | |
echo "[$filename] is a directory" | |
handle_directory "$filename" | |
else | |
echo "Skipping File[$filename]: (Already Synced)" | |
fi | |
done | |
} | |
for filename in ./*; do | |
if [[ "$filename" = *.cloud ]]; then | |
echo "File[$filename] not synced" | |
/usr/bin/python /home/sterlingbutters/.odrive-agent/bin/odrive.py sync "$filename" | |
elif [[ "$filename" = *.cloudf ]]; then | |
echo "File[$filename] not synced" | |
/usr/bin/python /home/sterlingbutters/.odrive-agent/bin/odrive.py sync "$filename" | |
elif [ -d "$filename" ]; then | |
echo "[$filename] is a directory" | |
handle_directory "$filename" | |
else | |
echo "Skipping File[$filename]: (Already Synced)" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment