LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-02-2003, 03:43 AM   #1
Narsil
LQ Newbie
 
Registered: Nov 2003
Posts: 3

Rep: Reputation: 0
.AppleDouble cleaning


Hi,

Here is the situation :

I have a shared win&macOS9 directory on a linux box, using a SMB and netatalk pointing on same dir.

Now, with OSX, I don't need netatalk anymore and use SMB for both macs and win.

Here is the problem :

Netatalk did scatter and fill .appledouble directories everywhere in the (complex and deep) shared structure.

I'm not a shell guru, so please help me to build the command line to recursively clean those .appledouble and the remove them. Can't manage it with rm and rmdir ...

TIA
 
Old 11-02-2003, 03:58 AM   #2
megaspaz
Senior Member
 
Registered: Nov 2002
Location: Silly Con Valley
Distribution: Red Hat 7.3, Red Hat 9.0
Posts: 2,054

Rep: Reputation: 46
find all those .appledouble directories and use:

rm -rf .appledouble

that will recursivley delete all files in that directory, files in any subdirectories, and the parent directory (.appledouble) without prompting you.
 
Old 11-02-2003, 08:24 AM   #3
Narsil
LQ Newbie
 
Registered: Nov 2003
Posts: 3

Original Poster
Rep: Reputation: 0
Yep,

The problem is finding them ... is the only way to browse the entire directory ?

I was wondering for a pipe command, something like find remove.

Suggestions ?
 
Old 11-02-2003, 01:09 PM   #4
megaspaz
Senior Member
 
Registered: Nov 2002
Location: Silly Con Valley
Distribution: Red Hat 7.3, Red Hat 9.0
Posts: 2,054

Rep: Reputation: 46
i just tried piping output of find to rm and it doesn't work. there's probably some fancy redirects your have to do or something to do it on one command line. you could probably make a basic script though that would work for you.

Code:
#!/bin/bash

find / -name ".appledouble" > $HOME/tmp.txt

while read line
do
	rm -rf "$line"
done < $HOME/tmp.txt

# delete tmp file
rm -f $HOME/tmp.txt

exit 0
 
Old 01-09-2004, 03:06 PM   #5
artur
Member
 
Registered: Apr 2002
Location: Illinois, US
Distribution: Red Hat, Fedora, Yellow Dog, Debian, FreeBSD, Embedix
Posts: 106

Rep: Reputation: 15
Quote:
Originally posted by Narsil
Yep,

The problem is finding them ... is the only way to browse the entire directory ?

I was wondering for a pipe command, something like find | remove.

Suggestions ?
How about:
Code:
find . -name \.AppleDouble -exec rm -rf {} \;
 
Old 04-22-2004, 11:19 PM   #6
greenhornet
Member
 
Registered: Mar 2002
Location: Sydney, Australia
Distribution: RHEL, Fedora, Yellow Dog
Posts: 43

Rep: Reputation: 15
Lightbulb

Although this isn't strictly what you were asking about I thought people might want to know this if they want to keep using netatalk and samba simutaneously.

Wherever you installed the netatalk binaries, in my case /usr/local/atalk/bin/ there is a perl script called cleanappledouble.pl

Running this will clean up any orphaned entries in a .Appledouble directory. For example if someone copies a file to the server using Appletalk and then removes it using the shell, ftp or samba it will leave behind the corresponding .Appledouble file.

I guess you could run this periodically in a cron job, I haven't tried this though in production so I don't know how well it works. This is also not mentioned at all in the official netatalk documentation, I just stumbled across it one day. At the very least it will remove unused files and as a result the number of inodes being used on your filesystem.
 
Old 04-22-2004, 11:23 PM   #7
greenhornet
Member
 
Registered: Mar 2002
Location: Sydney, Australia
Distribution: RHEL, Fedora, Yellow Dog
Posts: 43

Rep: Reputation: 15
Oh forgot to mention, it also has a recursive mode. So if you wanted to clean all the .Appledouble directories for the whole /home filesystem you would call it as such:

cleanappledouble.pl -r /home

If you run it without and parametres you get the usage information. Apparently it doesn't just remove orphaned directories it also -

Scans each directory and:
1) removes orphaned .AppleDouble files (from <directory>/.AppleDouble)
2) fixes permissions on .AppleDouble files to match corresponding data file (minus x bits)
3) fixes owner/group of .AppleDouble files to match corresponding data file (root only)
 
Old 04-24-2004, 11:36 AM   #8
Narsil
LQ Newbie
 
Registered: Nov 2003
Posts: 3

Original Poster
Rep: Reputation: 0
Well, not exactely what I was lookink for, but nice to know !

I solved my problem ... unelegantely : through samba, in windows, search all .appledouble files and delete them from the WIN search window ...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Cleaning up an old PC Merlyn Linux - Hardware 8 10-25-2005 06:33 AM
CRT cleaning... beaucoup Linux - Hardware 2 01-08-2004 08:17 PM
Cleaning Gentoo Crashed_Again Linux - Distributions 5 11-20-2003 10:24 AM
cleaning up? phonecian Linux - Software 1 10-19-2003 06:27 AM
Content-Type: multipart/appledouble - Mail Problem WeNdeL Linux - Software 1 09-02-2003 02:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:24 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration