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 > Webserver Backup Script

Webserver Backup Script
Thread Tools
Diggory Laycock
Professional Poster
Join Date: Oct 2001
Location: London
Status: Offline
Reply With Quote
Jul 27, 2002, 06:32 AM
 
I'm loving unix - just beginning to get stuck into Shell Scripting.

I basically want to back-up my web config and hosted files. Nothing new there!

I have knocked out the following script but it doesn't seem to preserve Permissions in the new copy.

</font><blockquote><font size="1" face="Geneva, Verdana, Arial, sans-serif">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;"> echo &quot;Backing-Up The Webserver Directory&quot;
cp -Rp /library/webserver/ /volumes/g4Sixty/back-ups/webserver/
echo &quot;Done!&quot;
</pre><hr /></blockquote><font size="1" face="Geneva, Verdana, Arial, sans-serif">Can anyone point out where I've (obviously) gone wrong?
     
bluehz
Dedicated MacNNer
Join Date: Feb 2001
Status: Offline
Reply With Quote
Jul 27, 2002, 07:44 AM
 
Are you copying to a different drive? If so you might want to do a "get Info" on the drive and check that the "Ignore Priviledges on this disk" is nbot checked. That would cause it to not retain your privs. Also - you might want to look into psync (see MacOSXHints.com) for your back/sync needs. Works fantastic!
     
Diggory Laycock  (op)
Professional Poster
Join Date: Oct 2001
Location: London
Status: Offline
Reply With Quote
Jul 27, 2002, 07:55 AM
 
</font><blockquote><font size="1" face="Geneva, Verdana, Arial, sans-serif">quote:</font><hr /><font size="1" face="Geneva, Verdana, Arial, sans-serif">Originally posted by bluehz:
<strong>Are you copying to a different drive? If so you might want to do a "get Info" on the drive and check that the "Ignore Priviledges on this disk" is nbot checked. That would cause it to not retain your privs. Also - you might want to look into psync (see MacOSXHints.com) for your back/sync needs. Works fantastic!</strong></font><hr /></blockquote><font size="1" face="Geneva, Verdana, Arial, sans-serif">Ha! thanks - the "ignore privs." checkbox was ticked. Thanks.

Also - Thanks for the tip on pSync - Fantastic. Had problems downloading and installing from within CPAN, but the Binary Dist worked fine.

<small>[ 07-27-2002, 08:38 AM: Message edited by: Diggory Laycock ]</small>
     
eno
Banned
Join Date: Sep 2000
Location: Fightclub
Status: Offline
Reply With Quote
Jul 28, 2002, 08:54 AM
 
tar is usually used for this kind of thing. It preserves permissions/ownerships etc.

See man tar for an example of a piped tar...
     
   
 
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 01:38 AM.
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.,