Deleting files on a NAS - How?

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

Deleting files on a NAS - How? Wed Feb 27, 2013 5:07 am • by grantxw8
Hi Guys,

I have several rules for deleting files from my NAS (using the "move to trash" action). One for old torrent files, another for empty folders and one to delete the "sample" files that come with many downloads. I'm pretty sure these used to work until recently but now, instead of deleting the files as expected, they are moved across my network into my laptop's trash and fill it up until the trash size limit is reached and Hazel kicks in.

I'm flummoxed. It doesn't seem to me that Hazel is "moving" the files as they remain on the NAS after being copied to the Trash. I have tried setting the options to "throw away if a duplicate" but the files are continuously copied and renamed. Is there a way to have Hazel just delete things on the NAS (in the Finder I just hold down cmd-opt-delete) without involving the laptop?

Any help or advice gladly received.

Cheers,

Grant
grantxw8
 
Posts: 11
Joined: Sat Feb 16, 2013 5:41 pm

Re: Deleting files on a NAS - How? Wed Feb 27, 2013 1:30 pm • by Mr_Noodle
Hazel tries to access the trash local to the drive but it may be the case that the drive in question does not have one and its permissions may be set incorrectly. What happens if you try and trash a file on that drive in Finder?
Mr_Noodle
Site Admin
 
Posts: 11865
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Deleting files on a NAS - How? Wed Feb 27, 2013 3:33 pm • by grantxw8
Thanks for the prompt reply.

I had to change permissions in order to delete a couple of the files. This explains why they couldn't be deleted.

To answer your question on what happens If I try to delete manually in the Finder: I get a message "Are you sure you want to delete FILENAME? This item will be deleted immediately. You can’t undo this action." If I choose "delete" then the files vanish. Alternately I can select a file and press "cmd-opt-delete" to avoid the warning.

One remaining empty folder cannot be deleted even manually. The Finder tells me that it is "in use". I'll have to Google how to deal with that.

I'm still puzzled as to why Hazel is copying files when I have asked it to move them. I'd have thought that a lack of permissions would have stopped Hazel being able to act on the file. Also, is there a way to prevent Hazel making the attempt to delete the files over and over thus slowing my network and filling my trash? Thanks again for your help.
grantxw8
 
Posts: 11
Joined: Sat Feb 16, 2013 5:41 pm

Re: Deleting files on a NAS - How? Fri Mar 01, 2013 5:15 pm • by Mr_Noodle
Are there any errors in the logs? Also, what kind of NAS is it and what file protocol is it using?

When doing a move across filesystems, it has to do a copy then delete the original. This is not Hazel-specific, it's just how it's done in the system. If there is something preventing the second phase then it might explain the behavior you are seeing. Also, some NASes don't implement the file protocols very well and may be doing something wrong or misreporting an error.
Mr_Noodle
Site Admin
 
Posts: 11865
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Deleting files on a NAS - How? Sat Mar 02, 2013 2:33 am • by grantxw8
Hi Mr Noodle,

Thanks for the reply again. I've had a busy busy time so have been unable to spend much time on this. I'm pretty sure from what you told me and what I read on a few other sites that it is a mixture of file permissions and the "file in use" problem.

To answer your questions, it is a Netgear ReadyNAS Duo (Sparc) and it is using AFP. As for the error logs here is a sample:

2013-02-26 05:30:49.843 hazelworker[50017] Processing folder Trash
2013-02-26 05:30:51.293 hazelworker[25876] Error moving file /Volumes/media/Downloading/[ http://www.Torrenting.com ] - Match.Of.The.Day.2013.02.23.720p.HDTV.x264-FTP/Sample/match.of.the.day.2013.02.23.720p.hdtv.x264-ftp.sample.mkv to /Users/gmc/.Trash/match.of.the.day.2013.02.23.720p.hdtv.x264-ftp.sample-27.mkv: -5000 - Insufficient access privileges for operation
2013-02-26 05:30:51.293 hazelworker[25876] [Error] Move failed: Could not move file match.of.the.day.2013.02.23.720p.hdtv.x264-ftp.sample.mkv from folder /Volumes/media/Downloading/[ http://www.Torrenting.com ] - Match.Of.The.Day.2013.02.23.720p.HDTV.x264-FTP/Sample to folder /Users/gmc/.Trash.
2013-02-26 05:30:51.350 hazelworker[25876] Arsenal vs Swansea: Rule Run these rules inside desktop folders matched.
2013-02-26 05:30:51.383 hazelworker[25876] 1162013ArsenalvsSwansea.flv: Rule Move any video to Media Sorting folder matched.
2013-02-26 05:30:51.400 hazelworker[25876] Could not set color label 1 for file /Volumes/media/Downloading/Arsenal vs Swansea/1162013ArsenalvsSwansea.flv: Error Domain=NSCocoaErrorDomain Code=513 "You don’t have permission to save the file “1162013ArsenalvsSwansea.flv” in the folder “Arsenal vs Swansea”." UserInfo=0x105b3f730 {NSURL=file://localhost/Volumes/media/Downloading/Arsenal%20vs%20Swansea/1162013ArsenalvsSwansea.flv, NSFilePath=/Volumes/media/Downloading/Arsenal vs Swansea/1162013ArsenalvsSwansea.flv, NSUnderlyingError=0x105b40af0 "The operation couldn’t be completed. Permission denied"}
2013-02-26 05:30:51.420 hazelworker[25876] completed: Rule Run these rules inside desktop folders matched.
2013-02-26 05:30:51.425 hazelworker[50017] Removing match.of.the.day.2013.02.23.720p.hdtv.x264-ftp.sample-28.mkv.
2013-02-26 05:30:51.428 hazelworker[50017] [Trash Event] File purged from Trash: Trash size is over the limit. File match.of.the.day.2013.02.23.720p.hdtv.x264-ftp.sample-28.mkv has been deleted.
2013-02-26 05:30:51.466 hazelworker[50017] Done processing folder Trash
2013-02-26 05:30:52.014 hazelworker[25876] Warning: predicted fire time is in the past: 2013-02-25 06:09:19 +0000
2013-02-26 05:30:52.458 hazelworker[50022] Could not convert alias to bookmark during decoding alias for /Volumes/media-1/Music: Error Domain=NSCocoaErrorDomain Code=260 "The file couldn’t be opened because it doesn’t exist."


I think the last part about "the file doesn't exist" is a separate problem that I may raise elsewhere but doesn't seem to causing any issues.

I managed to reset the permissions on the volume on the ReadyNAS and delete most of the files. This seems to be a problem with permissions generally on this NAS as almost all (probably every) file I download inside a folder seems to have the file permissions stuffed up. This is despite setting the NAS to make the permissions of files added to it the same as the parent volume. Anyway, there is a manual way to reset them as required and doing that allows Hazel to work it's magic.

The "file in use" issue is still defeating me but that is obviously not a Hazel problem. As yet I have not found any way to delete that file or the folder containing it. There must be a utility out there that will do it but it is proving elusive.

Thanks again for all your help.
grantxw8
 
Posts: 11
Joined: Sat Feb 16, 2013 5:41 pm

Re: Deleting files on a NAS - How? Tue Mar 05, 2013 4:36 pm • by Mr_Noodle
You can try What's Keeping Me (http://www.hamsoftengineering.com/products/wkm/wkm.html) to see what program may have that folder opened.
Mr_Noodle
Site Admin
 
Posts: 11865
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support