I have a lot of MP3s, and a pretty small hard drive (40GB) -- my brother's iPod is actually as roomy as my computer's hard drive! I tend to import a lot of songs, but I don't want to keep the files once iTunes has synched to the iPod. So the problem is how can I keep adding songs regularly to the iPod, but keep iTunes' synching feature working (as in not having it delete songs on the iPod which it doesn't find on my Mac anymore).
The trick is to import the songs in iTunes without copying them to the Library(set that option in iTunes' Preferences), synching with the iPod, and then truncating all the synched MP3s in the Mac's iTunes library to 0 bytes.
However, this command, which you might think would work...
~/incoming music> find . -name * -exec echo ""| cat > {} \;
... fails miserably. So instead, you can compile the following C program:
#include <stdlib.h>
int main(int argc, char **argv) {
char *target = argv[1];
FILE *file = fopen(target, "w");
fclose(file);
}
Compile it with g++, and use it in the find command as follows (assuming you named it truncate:
~/incoming music> find . -name *.mp3 -exec ./truncate {} \;
You can then sync again and admire how iTunes is tricked into thinking that the MP3s on the mac (which are 0 bytes in length) are still intact and identical to those on the iPod. Thus, iTunes simply avoids recopying them, leaving your iPod alone. Just remember to not completely erase those empty MP3 files on your Mac.
Mac OS X Hints
http://hints.macworld.com/article.php?story=20041217225838700