Page 1 of 1

Copy/Backup everything in a folder when a file changes

PostPosted: Wed Oct 26, 2016 5:31 am
by bonn
I searched on the forums for this but didn't really find what I was looking for.

Is there a way to make Hazel copy all of the files/subfolders/subfolderfiles, when a file changes in the rule folder?

I.e. copy the entire folder structure and its contents, when a file is updated – not necessarily just when it is created.

I tried the rule in the screenshot, and while it seemed to copy some subfolders and their contents to a Dropbox folder (iMac) with sorting to subfolder with date, it did not copy all the files in the folder.

Image

In case you were wondering, I'm trying to make automatic backups to Dropbox when my configuration files for BetterTouchTool changes.

Re: Copy/Backup everything in a folder when a file changes

PostPosted: Wed Oct 26, 2016 1:58 pm
by Mr_Noodle
If I'm understanding you correctly, you want to copy a folder if any file under it has changed? Do you actually need to perform the copy every time or are you just trying to mirror a folder to another location? If the latter, then see this thread on how to use the sync action to do that: viewtopic.php?f=4&t=1593#p6500

Re: Copy/Backup everything in a folder when a file changes

PostPosted: Fri Oct 28, 2016 3:05 pm
by bonn
Mr_Noodle wrote:If I'm understanding you correctly, you want to copy a folder if any file under it has changed? Do you actually need to perform the copy every time or are you just trying to mirror a folder to another location? If the latter, then see this thread on how to use the sync action to do that: viewtopic.php?f=4&t=1593#p6500


Hi MrNoodle, that's correct – I want to copy the folder and/or its files to a location whenever any file in it changes.
I don't edit the files often, so I would like to perform the copy every time.

From importing the Hazel rule attached in your forum link, I did however try a fusion of Syncing to a mirroring folder, like the rule already does, but also adding subsequential rules to Archive and then Sort into Subfolder (by current date).

Unfortunately, it didn't work that way. I thought adding sequential rules after Sync would perform the actions on the synced files, but instead it zipped and subsorted the files in the original folder.

Is there a way to make the subsequent rules after Sync happen on the synced files instead of the original files?

Re: Copy/Backup everything in a folder when a file changes

PostPosted: Mon Oct 31, 2016 11:07 am
by Mr_Noodle
You can't do that with that rule since it is set up to match the whole folder. Even if you set up the rules to sync individual files, the archives will be a bunch of individual archives for each file, which I am guessing is not what you want.

To get an archive of only the sync files, you'll have to set up a rule to match the files, copy them into a new folder, then have another rule archive that folder.