Mac Forums

Mac Forums (http://www.mac-forums.com/forums/)
-   Switcher Hangout (http://www.mac-forums.com/forums/switcher-hangout/)
-   -   zip problem (http://www.mac-forums.com/forums/switcher-hangout/248506-zip-problem.html)

John Greer 08-23-2011 12:15 PM

zip problem
 
I'm new to Apple (converted in June, from decades of PC).
I want to archive my MS Office backup files.
I had no trouble doing it on my PC, but I'm having trouble converting the command to run on my Mac.
I have it running (made it executable), but it's not finding my files.

When I run:
Code:

#!/bin/bash
zip -m -r -o -9 -dc -dd  /Volumes/Backup2048/Word /Volumes/*.wbk "/Volumes/Backup of*.docx"

I get these messages:
zip warning: name not matched: /Volumes/*.wbk
zip warning: name not matched: /Volumes/Backup of*.docx
btw - Backup2048 is my USB backup drive and HDD2048 is my internal drive.

HELP!

Dysfunction 08-23-2011 02:37 PM

Ok, first.. what's the expected output? Are you trying to create a single zip of the contents of all .wbk files in

Volumes/Backup2048/Word\ /Volumes/

Or are you trying to zip each wbk file?

John Greer 08-23-2011 04:24 PM

I'm trying to create a single Zip file called WORD in the /Volumes/Backup2048/ folder. This zip file will contain all the *.wbk and Backup*.docx files on any drive on my iMac.

I think my problem is more fundamental.

:Confused:

If I say
ls -G -h -k -R /Volume/*.wbk
it returns
ls: /Volume/*.wbk: No such file or directory
yet if I drill down to the directory that contains the files, the LS command works. It's almost as if the -R switch is not working for this command. -R works for other files. Strange...

Dysfunction 08-23-2011 04:30 PM

Oh! Try this

find / -name *.wbk

That should show every file on your system (from the root dir / down). I really prefer find to ls for this type of work in general

chas_m 08-24-2011 12:39 AM

Wouldn't making a smart folder of all *.wbk files and then archiving them (right click) be both faster and more elegant? Or did I miss something?

Dysfunction 08-24-2011 01:01 AM

Possibly. It depends on what your definition of 'more elegant' is I suppose. Personally I'd have done something like...

find / -name *.wbk -exec zip -g /path/to/whatever.zip {} ';'

Since I'm RARELY in Finder, but ALWAYS have a terminal window open, for me.. this IS more elegant. Especially if you cron it ;)

chas_m 08-24-2011 02:25 AM

Oh you UNIX/CLI geeks!

dtravis7 08-24-2011 02:49 AM

Quote:

Originally Posted by chas_m (Post 1287446)
Oh you UNIX/CLI geeks!

I was like that except a DOS command line freak! Loved even in Windows to use the DOS command prompt. I know a little Unix and terminal, but for what the OP is doing, I probably would just get the files together and right click! :D

Dysfunction 08-24-2011 03:08 AM

Quote:

Originally Posted by chas_m (Post 1287446)
Oh you UNIX/CLI geeks!

So, how exactly does one with a fine arts education get into development? I have nooooo idea. O:)

John Greer 08-24-2011 09:50 AM

Quote:

Originally Posted by Dysfunction (Post 1287238)
Oh! Try this

find / -name *.wbk

That should show every file on your system (from the root dir / down). I really prefer find to ls for this type of work in general

That command found the files!
That's the good news.
Now if I could only figure out why zip is not working...

John Greer 08-24-2011 09:52 AM

Quote:

Originally Posted by chas_m (Post 1287421)
Wouldn't making a smart folder of all *.wbk files and then archiving them (right click) be both faster and more elegant? Or did I miss something?

Being new to Mac, the obvious question is, "What's a Smart Folder?"

Time for me to read some...

[edit]
Thanks for the pointer to Smart Folders. This looks like a good way to repeatedly find stuff, but I'd still like zip to be able to find and remove certain files for me.
[/edit]


All times are GMT -4. The time now is 03:06 AM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.