Skip to content

Instantly share code, notes, and snippets.

@paprikka
Created October 3, 2023 10:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paprikka/8824b280181a642b378df65f83a7ca90 to your computer and use it in GitHub Desktop.
Save paprikka/8824b280181a642b378df65f83a7ca90 to your computer and use it in GitHub Desktop.
how to force iCloud download in a dir
#!/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