zip problem

Joined
Jun 20, 2011
Messages
70
Reaction score
0
Points
6
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!
 
Joined
Mar 17, 2008
Messages
6,879
Reaction score
191
Points
63
Location
Tucson, AZ
Your Mac's Specs
Way... way too many specs to list.
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?
 
OP
John Greer
Joined
Jun 20, 2011
Messages
70
Reaction score
0
Points
6
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...
 
Joined
Mar 17, 2008
Messages
6,879
Reaction score
191
Points
63
Location
Tucson, AZ
Your Mac's Specs
Way... way too many specs to list.
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
 
C

chas_m

Guest
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?
 
Joined
Mar 17, 2008
Messages
6,879
Reaction score
191
Points
63
Location
Tucson, AZ
Your Mac's Specs
Way... way too many specs to list.
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 ;)
 

dtravis7


Retired Staff
Joined
Jan 4, 2005
Messages
30,133
Reaction score
703
Points
113
Location
Modesto, Ca.
Your Mac's Specs
MacMini M-1 MacOS Monterey, iMac 2010 27"Quad I7 , MBPLate2011, iPad Pro10.5", iPhoneSE
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
 
OP
John Greer
Joined
Jun 20, 2011
Messages
70
Reaction score
0
Points
6
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...
 
OP
John Greer
Joined
Jun 20, 2011
Messages
70
Reaction score
0
Points
6
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]
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top