Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the '10.4: An Automator plug-in to tar and gzip in the Finder' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.4: An Automator plug-in to tar and gzip in the Finder
Authored by: SimonDorfman.com on Aug 05, '05 11:22:08AM

I wonder if there's an easy way to exclude .DS_STORE files from the tar gzips. Ideas anyone?



[ Reply to This | # ]
10.4: An Automator plug-in to tar and gzip in the Finder
Authored by: owsla on Aug 05, '05 11:46:10AM

In the Automator action, try changing the line:

tar czf "$file.tgz" "$file"

to:

tar czf --exclude ".DS_STORE" "$file.tgz" "$file"



[ Reply to This | # ]
10.4: An Automator plug-in to tar and gzip in the Finder
Authored by: jwbales on Aug 05, '05 11:49:14AM
Open the workflow in Automator and change the script. Change:
tar czf "$file.tgz" "$file"
To:
tar --exclude=".DS_Store" -czf "$file.tgz" "$file"


[ Reply to This | # ]
10.4: An Automator plug-in to tar and gzip in the Finder
Authored by: SimonDorfman.com on Aug 05, '05 04:32:34PM
Thanks for your help with this. I made one to make zip archives that exclude .DS_Store files too. Here's the code:

for f in "$@"
do
	path=`dirname "$f"`
	file=`basename "$f"`
	cd "$path"
	zip -r "$file.zip" "$file" -x \*.DS_Store
done
I just replaced the line
tar --exclude=".DS_Store" -czf "$file.tgz" "$file"
with this one:
zip -r "$file.zip" "$file" -x \*.DS_Store
This actually excludes any file ending with .DS_Store. I couldn't figure out the syntax to specify just one file. Reading man pages is still new to me. But how often do you have a file called my_important_document.DS_Store ? Right, me neither, so this script works fine then :-)

[ Reply to This | # ]