Hazel sync with with delete files option

Talk, speculate, discuss, pontificate. As long as it pertains to Hazel.

Moderators: Mr_Noodle, Moderators

Hazel sync with with delete files option Tue May 29, 2012 3:19 pm • by Kentar_lux
Hey,

First of all, great work on Hazel 3.0, just love it!

A small request though (or hint if I did miss something): would it be possible to implement a 'delete' option into the sync ability?

The problem is I have a couple of folders set to sync with a backup drive. Now, the current implementation leaves files, that no longer exist in the source folder, at the destination.

Now I reckon a two-way sync is beyond the scope of Hazel. I'm talking more of a one way sync, so that the destionation is a perfect mirror of the source.

Cheers!

ps: growl notification if Hazel deletes files from Trash would also be welcome :D
Kentar_lux
 
Posts: 5
Joined: Tue May 29, 2012 2:39 pm

The sync does delete. I think the problem is that you are syncing the wrong thing.

If you apply the sync action to a file, that file will be copied over and it will get any changes to the file. If the file is deleted, there's no file for a rule to match so it won't get deleted. You need to sync the folder containing the file for the file deletion to get picked up. One way to look at it is that the files in a folder are the folder's contents so you need to sync the folder to catch all the changes in the folder.
Mr_Noodle
Site Admin
 
Posts: 11193
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

I see what you mean.

I was trying to sync an external drive when it was connected for backup purposes, so I dragged the mounted drive icon from the desktop to Hazel.

As I deleted a directory from the drive, Hazel couldn't run the rule on it, since it was no longer present.

Any solution to the problem that the drive is already the topmost directory here, and that there is no containing folder for the drive? (the /Volumes folder gives the same result)

Thanks for the help!
Kentar_lux
 
Posts: 5
Joined: Tue May 29, 2012 2:39 pm

You can monitor the Volumes folder and have Hazel match the name of the specific drive in question. Does that not work for you?
Mr_Noodle
Site Admin
 
Posts: 11193
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Hazel sync with with delete files option Sat Jun 02, 2012 11:46 pm • by Kentar_lux
Ok, can confirm I got it to work.

For anyone wanting to recreate this, you add the "/Volumes" folder to Hazel's watch list, then for each drive you want to keep a backup, you add a rule that matches the name, and some 'date last matched' condition e.g. to 'is not in the last 24 hours' to throttle backup.

So simple to automatically backup external drives!

Hazel ftw :))

PS: if you need any more refined instructions, let me know
Kentar_lux
 
Posts: 5
Joined: Tue May 29, 2012 2:39 pm

Could you elaborate on what you mean by "volume of Hazel"?
Mr_Noodle
Site Admin
 
Posts: 11193
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Sorry, still not sure what you are referring to here. Can you provide a concrete example?
Mr_Noodle
Site Admin
 
Posts: 11193
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Hazel sync with with delete files option Thu Jul 10, 2014 12:24 pm • by nicholasds
Hi

I'm having a similar issue with Hazel. I am monitoring a folder on my external drive and syncing it to my desktop which gets backed up to the cloud. When I make changes within the folder to either sub folders or files it does not delete the files which I delete but leaves them in the synced folder. Any new files get synced without issue?
nicholasds
 
Posts: 6
Joined: Thu May 08, 2014 4:07 pm

Can you give specific details about what folder Hazel is monitoring and what folder is being synced? I suspect you need to have Hazel monitor one folder up but if you provide more details I can better tell.
Mr_Noodle
Site Admin
 
Posts: 11193
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Hi

Thanks for the quick response. I have attached two images to show my setup.

Image

Image
nicholasds
 
Posts: 6
Joined: Thu May 08, 2014 4:07 pm

So, what's the folder you want to sync? Is it the Soldier drive or the folders directly underneath it?
Also, you should check out this thread on syncing: viewtopic.php?f=4&t=1593#p6500
Mr_Noodle
Site Admin
 
Posts: 11193
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

I want to sync all of the folders inside the Soldier drive into another folder called "Art". The sync works for new files or when I move existing files but it won't delete any files I delete. Also, when I move files it moves them into the new directory but leaves a copy in the old directory as well.
nicholasds
 
Posts: 6
Joined: Thu May 08, 2014 4:07 pm

After trying your sync recipe I get the error 23 whenever it tries to sync. Here's my log:

2014-07-11 13:17:40.602 hazelworker[1395] [Error] Could not sync file/folder: Could not sync file/folder at Gnomon to /Volumes/Titan/Art/Gnomon.
2014-07-11 13:17:40.602 hazelworker[1395] Sync returned error status: 23
2014-07-11 13:17:40.604 hazelworker[1395] Assets: Rule Sync matched.
2014-07-11 13:17:40.637 hazelworker[1408] ###main load address: 0x10ba2c000
2014-07-11 13:17:40.638 hazelworker[1408] ###Noodle load address: 0x10bb0f000
2014-07-11 13:17:40.638 hazelworker[1408] ###CK load address: 0x10bacd000
2014-07-11 13:17:40.646 hazelworker[1408] Processing folder Trash
2014-07-11 13:17:41.678 hazelworker[1408] Done processing folder Trash
2014-07-11 13:17:49.417 hazelworker[1416] ###main load address: 0x108aeb000
2014-07-11 13:17:49.417 hazelworker[1416] ###Noodle load address: 0x108bc5000
2014-07-11 13:17:49.417 hazelworker[1416] ###CK load address: 0x108b86000
2014-07-11 13:17:49.425 hazelworker[1416] Processing folder Trash
2014-07-11 13:17:50.546 hazelworker[1416] Done processing folder Trash
2014-07-11 13:18:19.404 hazelworker[1395] [Error] Could not sync file/folder: Could not sync file/folder at Assets to /Volumes/Titan/Art/Assets.
2014-07-11 13:18:19.404 hazelworker[1395] Sync returned error status: 23
2014-07-11 13:18:19.424 hazelworker[1395] Books: Rule Sync matched.
2014-07-11 13:18:19.689 hazelworker[1395] [Error] Could not sync file/folder: Could not sync file/folder at Books to /Volumes/Titan/Art/Books.
2014-07-11 13:18:19.689 hazelworker[1395] Sync returned error status: 23
2014-07-11 13:18:19.690 hazelworker[1395] Screen Recording: Rule Sync matched.
2014-07-11 13:18:19.820 hazelworker[1395] [Error] Could not sync file/folder: Could not sync file/folder at Screen Recording to /Volumes/Titan/Art/Screen Recording.
2014-07-11 13:18:19.820 hazelworker[1395] Sync returned error status: 23
2014-07-11 13:18:19.842 hazelworker[1395] Inspiration: Rule Sync matched.
2014-07-11 13:18:20.485 hazelworker[1429] ###main load address: 0x101244000
2014-07-11 13:18:20.485 hazelworker[1429] ###Noodle load address: 0x101321000
2014-07-11 13:18:20.485 hazelworker[1429] ###CK load address: 0x1012e1000
2014-07-11 13:18:20.595 hazelworker[1429] Processing folder Trash
2014-07-11 13:18:20.952 hazelworker[1395] [Error] Could not sync file/folder: Could not sync file/folder at Inspiration to /Volumes/Titan/Art/Inspiration.
2014-07-11 13:18:20.952 hazelworker[1395] Sync returned error status: 23
2014-07-11 13:18:20.953 hazelworker[1395] Tutorials: Rule Sync matched.
2014-07-11 13:18:22.034 hazelworker[1429] Done processing folder Trash
nicholasds
 
Posts: 6
Joined: Thu May 08, 2014 4:07 pm

Re: Hazel sync with with delete files option Mon Jul 14, 2014 11:27 am • by Mr_Noodle
Turn on debug mode as described here: viewtopic.php?f=4&t=296

Also, if you want to sync everything in Soldier, you probably want to have Hazel monitor the /Volumes directory and then have the rule match the Soldier drive and sync that.
Mr_Noodle
Site Admin
 
Posts: 11193
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Hi

I have now updated my setup with the recipe you suggested as follows:

Image
Image

I have moved everything from my SOLDIER drive into a new folder inside the drive called "Art". So now I'm using the sync to sync everything inside that folder with my drive on my mac.

I am still getting the same result however. The sync works but if I delete or move files within the directory the sync does not delete the old files. If I move files it will add the new files to the new directory but still leaves the old copies behind.

I've enabled debug mode and here's a link to the log file.

http://www.nickdasilva.com/wp-content/uploads/2014/07/Hazel.log
nicholasds
 
Posts: 6
Joined: Thu May 08, 2014 4:07 pm

Next

Return to Open Discussion