Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > macOS > How do I copy or archive protected files?

How do I copy or archive protected files?
Thread Tools
solmaker
Fresh-Faced Recruit
Join Date: Feb 2003
Status: Offline
Reply With Quote
Nov 2, 2007, 07:46 PM
 
I've periodically run into trouble doing tasks like the following:
1) Archiving big folders fails upon hitting certain protected files.
3) For example, stuffing failed for the Previous System folder created by a Tiger upgrade (my intent was to stuff and delete to see whether any of these files were still needed).
3) Ditto trying to copy such folders to an external FAT32 hard drive.

What am I missing? What is a reliable method for backing up or archiving selected folders without risk of aborting in the middle if a protected file is encountered?
     
mduell
Posting Junkie
Join Date: Oct 2005
Location: Houston, TX
Status: Offline
Reply With Quote
Nov 2, 2007, 09:35 PM
 
Use cp at the command line instead of some pansy GUI thing?
     
rehoot
Dedicated MacNNer
Join Date: Nov 2005
Status: Offline
Reply With Quote
Nov 3, 2007, 01:28 AM
 
Originally Posted by mduell View Post
Use cp at the command line instead of some pansy GUI thing?
Yes, but you might have to add the sudo command to execute the command as the root user. If you are using those "pansy GUI" applications, you might have never activated the root user. If so, you have to activate it (once) by running the NetInfo program, which is in the Applications/Utility folder. Look under the Security menu and run "Activate root user". DO NOT FORGET THE PASWORD!!!

Now you can open a Terminal window (look in the Applications/Utilities folder) and run a command like:
sudo cp /somefolder/somefile /destinationfolder

You might also read about the tar command and practice using it. To copy to another drive, you might need to enter the drive name as [YY]/Volumes/VolumeName[/TT]. If you type a few letters of the folder name and hit the escape key, the computer will try to complete typing the folder name for you if it can.
Mac Pro Quad: 2.66GHz; 4 GB Ram; 4x500GB drives; Radeon X1900, 23" Cinema Screen, APC UPS
PowerBook G4: 1.33GHz; 768MB Ram; 60GB drive
     
Ganesha
Senior User
Join Date: Jul 2002
Location: Arizona Wasteland
Status: Offline
Reply With Quote
Nov 3, 2007, 06:09 AM
 
Originally Posted by rehoot View Post
Yes, but you might have to add the sudo command to execute the command as the root user. If you are using those "pansy GUI" applications, you might have never activated the root user. If so, you have to activate it (once) by running the NetInfo program, which is in the Applications/Utility folder. Look under the Security menu and run "Activate root user". DO NOT FORGET THE PASWORD!!!

Now you can open a Terminal window (look in the Applications/Utilities folder) and run a command like:
sudo cp /somefolder/somefile /destinationfolder.
Um, you don't need to activate the root user to either 'sudo [command]', or 'sudo su'.

Back to the original question. By stuff, I hope you don't mean use an application with Stuffit in its name. If so stuff stuffit in the trash.

Previous System Folder, resulting from an archive install, means just that. Previous as in not being used anymore.

If you 'must' copy your system files use an application like SuperDuper or Carbon Copy to do it.
     
solmaker  (op)
Fresh-Faced Recruit
Join Date: Feb 2003
Status: Offline
Reply With Quote
Nov 3, 2007, 08:22 PM
 
Thanks for the suggestions. I just tried "cp -r" from the Terminal window to copy the Previous Systems folder prior to deletion. However, it's emitting a series of jive warning messages such as:

cp: Previous System 1/var/root: Permission denied
cp: Previous System 1/var/run/sudo: Permission denied
cp: Previous System 1/var/run/netinfo_local.pid: Permission denied
cp: Previous System 1/var/run/pppconfd: Operation not supported on socket
cp: Previous System 1/var/spool/clientmqueue: Permission denied
cp: Previous System 1/Library/Java/Home/bin/javaws: No such file or directory
cp: Previous System 1/Library/Caches/Desktop Pictures/alia.4270840: Permission denied
etc., etc.

This behavior is not unlike my reported problems using other methods, although at least cp proceeds to completing and gives a full log of all skipped files. But the end result is the same: an incomplete and unusable backup copy.

I've just downloaded Carbon Copy Cloner and will see what it has to offer. But is what I'm trying to do so unusual... just trying to move junk on and off my hard drive in a recoverable manner?!? I'm not even mucking with the System folder, or trying to touch files that are in use by other programs!
     
mduell
Posting Junkie
Join Date: Oct 2005
Location: Houston, TX
Status: Offline
Reply With Quote
Nov 3, 2007, 09:48 PM
 
You need to use sudo...
     
solmaker  (op)
Fresh-Faced Recruit
Join Date: Feb 2003
Status: Offline
Reply With Quote
Nov 5, 2007, 02:37 AM
 
Okay, sudo is what I've been missing. Thanks from this Unix novice.

But why in general does the MacOS GUI make it so hard to reliably move a directory to a backup device using standard Finder techniques?
     
Big Mac
Clinically Insane
Join Date: Oct 2000
Location: Los Angeles
Status: Offline
Reply With Quote
Nov 5, 2007, 02:49 AM
 
Because some tasks that are seldom performed by people are better handled by the command line or a utility. The Finder is a general purpose, general user tool.

"The natural progress of things is for liberty to yield and government to gain ground." TJ
     
rehoot
Dedicated MacNNer
Join Date: Nov 2005
Status: Offline
Reply With Quote
Nov 5, 2007, 08:20 AM
 
Originally Posted by solmaker View Post
Okay, sudo is what I've been missing. Thanks from this Unix novice.

But why in general does the MacOS GUI make it so hard to reliably move a directory to a backup device using standard Finder techniques?
You can use DiskUtility to make backup copies of folders or your entire disk. It will prompt you to enter the root user ID if it needs to copy protected files. Depending on what you are doing with the files, you might need to use the other applications (such as if you want to send files to a Windows user).
Mac Pro Quad: 2.66GHz; 4 GB Ram; 4x500GB drives; Radeon X1900, 23" Cinema Screen, APC UPS
PowerBook G4: 1.33GHz; 768MB Ram; 60GB drive
     
solmaker  (op)
Fresh-Faced Recruit
Join Date: Feb 2003
Status: Offline
Reply With Quote
Nov 5, 2007, 02:15 PM
 
I don't see in Disk Utility where one can selectively backup selected folders... only whole disks. Where is the menu selection for backing up a folder? Also, once backed up, I'm not sure that Finder would permit "protected" files to be deleted off the hard disk.
     
rehoot
Dedicated MacNNer
Join Date: Nov 2005
Status: Offline
Reply With Quote
Nov 5, 2007, 05:42 PM
 
Originally Posted by solmaker View Post
I don't see in Disk Utility where one can selectively backup selected folders... only whole disks. Where is the menu selection for backing up a folder? Also, once backed up, I'm not sure that Finder would permit "protected" files to be deleted off the hard disk.
Look under the Images menu, then choose "New" and then "New Image from folder." It will create a .dmg file. You can also choose encryption to make it secure.

You can also use Disk Image to create a blank, read/write disk image that is encrypted. You can then put your private information there and open it only when you need that info--be sure to pick a strong password. This way, if you have to send your computer for service, the repair person can't see your banking info or other private files.
Mac Pro Quad: 2.66GHz; 4 GB Ram; 4x500GB drives; Radeon X1900, 23" Cinema Screen, APC UPS
PowerBook G4: 1.33GHz; 768MB Ram; 60GB drive
     
Hal Itosis
Grizzled Veteran
Join Date: Mar 2004
Status: Offline
Reply With Quote
Nov 5, 2007, 07:07 PM
 
Originally Posted by solmaker View Post
3) Ditto trying to copy such folders to an external FAT32 hard drive.
What is a reliable method for backing up or archiving selected folders
without risk of aborting in the middle if a protected file is encountered?
 
Yup... that's right.
See: man ditto
-HI-
     
solmaker  (op)
Fresh-Faced Recruit
Join Date: Feb 2003
Status: Offline
Reply With Quote
Nov 6, 2007, 02:38 AM
 
Thanks, Disk Utility was the ticket. BTW, sudo cp strangely created a folder that was 1.5 times the size of the original folder.
     
mduell
Posting Junkie
Join Date: Oct 2005
Location: Houston, TX
Status: Offline
Reply With Quote
Nov 6, 2007, 06:29 PM
 
Originally Posted by solmaker View Post
Thanks, Disk Utility was the ticket. BTW, sudo cp strangely created a folder that was 1.5 times the size of the original folder.
Got symlinks?
     
Hal Itosis
Grizzled Veteran
Join Date: Mar 2004
Status: Offline
Reply With Quote
Nov 6, 2007, 08:19 PM
 
FWIW,

I believe that -- under the hood -- both Disk Utility and Carbon Copy Cloner
do [or did?] use /usr/bin/ditto as their copying "engine"... whereas, the folks
at Shirt Pocket wrote their own:

/SuperDuper!.app/Contents/MacOS/SDCopy
-HI-
     
solmaker  (op)
Fresh-Faced Recruit
Join Date: Feb 2003
Status: Offline
Reply With Quote
Nov 6, 2007, 10:10 PM
 
mduell - I don't know whether there were symlinks in the Previous Systems folder created after upgrading to Tiger (and now I've deleted that folder after compressing to a disk image so I can't easily check). Are you saying that any such alias are expanded by cp to its full original? BTW, it seems that the only thing in Previous Systems which was actively in use were two CanoScan drivers that were automatically installed when I long ago connected to a USB scanner. Annoyingly, together they were using up 1% of physical memory and 0.2% of CPU just sitting there doing nothing with no scanner is use.

Hal Itosis - Is ditto better or worse than SuperDuper's method?
     
CharlesS
Posting Junkie
Join Date: Dec 2000
Status: Offline
Reply With Quote
Nov 6, 2007, 10:23 PM
 
I doubt they "wrote their own" - they're probably just copying files using the normal file system APIs. Carbon Copy Cloner is limited in that regard, because it's just an AppleScript, not a full-blown app. The separate binaries just contain the portions of the app that need to run as root (that way, the main application can launch them with administrative privileges and communicate back and forth with them).

Ticking sound coming from a .pkg package? Don't let the .bom go off! Inspect it first with Pacifist. Macworld - five mice!
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 10:46 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,