Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

John Greer

macrumors member
Original poster
Jun 20, 2011
75
1
Wayne, NJ USA
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!
 
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!

When I first came from DOS to Unix, I did things in steps.

First you need a list of all the files you need backed up.

Try

ls /Volumes/Backup2048/Word /Volumes/*.wbk

This should give you the list of files you want.

The next thing to do is look at the man page for zip.

Another place to read is Unix for DOS users here.

The UNIX shell is a lot more powerful than the DOS shell and you can't issue a DOS command in the UNIX shell and get the same results. For instance, when the shell sees *, it gets expanded in place, right there in your command line, to a list of every file in the current folder, before the shell even looks at the next word you typed after * to see what you wanted to do. There is an example given in the zip man page that uses find. Find produces predictable results.

Try

find . -name "*.wbk" -print

You get a listing of all the wbk files in your current folder and all folders beneath your current folder.

Also blanks are death. How does the shell know you are done saying one thing and ready to say something else? A blank. There are blanks all over the place on OS X and Windows folders but when I'm trying to set up folders to use with bash shell commands, I avoid using blanks. I either use underscores like my_photos or if I can't avoid blanks, I use "\ " backslash blank to let the shell know the blank is not a delimiter but just another character in the string I'm typing.



hope this helps
 
Last edited:
:confused:

If I say
ls -G -h -k -R /Volume/Backup*.docx
it returns
ls: /Volume/Backup*.docx: 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...

ls -G -h -k -R : /Volume/Backup*
also returns nothing.
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.