Created
October 3, 2023 10:36
-
-
Save paprikka/8824b280181a642b378df65f83a7ca90 to your computer and use it in GitHub Desktop.
how to force iCloud download in a dir
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 a directory is provided | |
if [ -z "$1" ] | |
then | |
echo "No directory provided" | |
exit 1 | |
fi | |
# Check if the provided directory exists | |
if [ ! -d "$1" ] | |
then | |
echo "Directory $1 does not exist" | |
exit 1 | |
fi | |
# Recursively list all files and pass each to 'head -c 1' if it's empty | |
find "$1" -type f | while read -r file | |
do | |
if [ -s "$file" ] | |
then | |
echo $file | |
brctl download '$file' | |
# perhaps this could work? | |
# head -c 1 "$file" | |
fi | |
done | |
echo "Complete" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment