My Hazel Rule runs on ~/Cloudstorage/Dropbox/Projects
In the projects folder are different folders for each project. Each may have other subfolders.
First rule:
Locate all sub folders
If ALL of the following conditions are met
Kind is Folder
Do the following:
Run rules on folder contents
Continue matching rules
(WORKS)
Second Rule
Prevent Dropbox sync of Auto-Backup Folders
Some folders may contain Auto-Backup Folders. This script prevents the auto backup of those folders.
If all of the following conditions are met
Name is auto-backups
Do the following
Run shell script embedded script /bin/sh
xattr -w 'com.apple.fileprovider.ignore#P' 1 "$1"
Set color label orange.
(WORKS)
Third rule: Mark and move folders
If at least one file in the folder is younger than 14 days, the folder is considered "in progress". If not, the folder is
considered a legacy folder and should be moved.
If all conditions are met
Passes shell script embedded script /bin/zsh
RECENT_FILES=$(find "$1" -type f -mtime -14 -print -quit)
if [ -z "$RECENT_FILES" ]; then
exit 0
fi
exit 1
Subfolder Depth is 0
Do the following matched file or folder
Set color label "red".
Now: The idea would be to use the move command to Move the legacy folders into folder "Project Legacy". The "age" of the folder is correctly identified and set to red. However, moving does not work.
Then I Tried "Sync into folder "Project Legacy"". This does work.
Then: Move to folder "Trash". The folders are gone, but not in the Trash. Why?
I don't know why the folder content is not moved (I have piped the output from Hazel which contains the correct path and the mv command works. When using "MOVE" or an embedded script
mv -v "$1" "~/Documents/Projects\ Legacy/." 2>&1 >> ~/Documents/test.log
the command is not executed at all, no output in test.log
when using echo, the current path is written to test.log, using the mv command, it works perfectly.
What is curious, that the moving to trash command does not work properly, so I am concerned that my script is somehow shady,
although the moving itself via sync seems to work.
Sorry for the long post, but I really don't know how to proceed-
Best regards,
Oliver