Shirt Pocket Discussions

Shirt Pocket Discussions (https://www.shirt-pocket.com/forums/index.php)
-   Frequently Asked Questions (https://www.shirt-pocket.com/forums/forumdisplay.php?f=7)
-   -   When I try to copy a single directory, I end up copying the whole disk. Why? (https://www.shirt-pocket.com/forums/showthread.php?t=87)

dnanian 06-22-2004 06:59 PM

When I try to copy a single directory, I end up copying the whole disk. Why?
 
This trips me up all the time, though I rarely get the question in support. But, since I'm asking... :)

Let's say you wanted to copy all user's Documents directories from the source to the destination. To do so, you might try just adding one command:

(copy) Users/*/Documents

But, when you run this, all files are copied. What's going on?

By default, an "empty" copy script copies all files from the source to the destination. So, adding a single command to just copy a directory (or group of directories, as above) is vaguely redundant: it's doing that already.

To resolve the issue, you first have to tell SuperDuper! to not copy everything, and then tell it what you want to copy. So, rather than one command, you'd have three:

(ignore) *
(ignore) .*
(copy) Users/*/Documents

That basically says to ignore (don't copy) all files, and then says "well, except you should copy Users/*/Documents!"

So, why two commands for the ignore -- with * and .*?

SuperDuper! uses Unix "globbing" rules to match wildcards like this. By definition, files that start with a period (.) are hidden, and don't match a wildcard. To ensure all regular and hidden files are ignored, you must specify both all files (*) and all hidden files (.*).

OK! Next question?


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

Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2024, vBulletin Solutions, Inc.