FutureQuest, Inc. FutureQuest, Inc. FutureQuest, Inc.

FutureQuest, Inc.
Go Back   FutureQuest Community > General Site Owner Support (All may read/respond) > General Coding/Development
User Name
Password  Lost PW

 
Thread Tools Display Modes
Old 10-20-2003, 06:35 PM   Postid: 98281
jeep
Site Owner
 
jeep's Avatar

Forum Notability:
34 pts: User-friendly
[Post Feedback]
 
Join Date: Dec 2001
Location: Brighton, United Kingdom
Posts: 229
Backing up with tar

Hi

I'm backing up our sites with some cron jobs... the bit in question is...

Code:
/bin/tar -cf sitebackup.tar /big/dom/xsite/www/*
I've looked at UNIX in a nutshell and the man pages but can't figure out how to have all of the www/ directory stored in the archive EXCEPT some subdirectories (in my case ../www/galleries/ or ../www/files/).

Any ideas on how to do this???

Jason
__________________
Swing Digital - online community consultancy
jeep is offline  
Old 10-20-2003, 06:43 PM   Postid: 98283
 Kevin
Systems Administrator
 
Kevin's Avatar
 
Join Date: Aug 2001
Location: Orlando, FL
Posts: 2,084
Jason,
The easiest way is to create an exclude file which is just a plain text file containing a list of the files you do not want to backup. Then you use the --exclude-from option on tar (see man tar for more info).

Btw, you can also use the -z parameter on tar command to compress the archive with gzip to save space since tar by itself is not compressed.

--
Kevin
Kevin is offline  
Old 10-21-2003, 08:49 AM   Postid: 98320
jeep
Site Owner
 
jeep's Avatar

Forum Notability:
34 pts: User-friendly
[Post Feedback]
 
Join Date: Dec 2001
Location: Brighton, United Kingdom
Posts: 229
Doh! Well that exclude-from option does appear if you look at man tar on the FQ systems. I was looking at the man pages on MacOS X which are rather more concise and refer (it would seem) to the BSD version and not a GNU one.

Thanks for the -z option, actually I'm bzipping them as it's more efficient ie smaller files to download.

regards,
Jason
__________________
Swing Digital - online community consultancy
jeep is offline  
Old 10-21-2003, 03:35 PM   Postid: 98365
 Terra
CTO FutureQuest, Inc.
 
Terra's Avatar
 
Join Date: Jun 1998
Location: Z'ha'dum
Posts: 7,518
Quote:
I was looking at the man pages on MacOS X which are rather more concise

If you would like more detailed information about 'tar' on our servers, then try:
$ info tar

The 'tar' manual page itself is meant to be short, sweet, and too the point to serve as a quick reference... The Info page has a more user friendly guide...

--
Terra
--if you think 'tar' switches are abundant - take a look at 'cpio' or 'rsync' one day--
FutureQuest
Terra is offline  
Old 10-22-2003, 03:58 PM   Postid: 98461
JRepici
Site Owner
 
JRepici's Avatar

Forum Notability:
10 pts: User-friendly
[Post Feedback]
 
Join Date: Feb 2000
Location: Riverside, NJ
Posts: 476
NEV-ermind

Got it working.

Not sure exactly why I got this to work. One thing I did learn while experiminting on my own is that wildcards continue to reference the directory you started in even after a -C, so "... -C ..\otherDir\ *" looks in the "otherDir" for those filenames it found in the directory where you started tar (not the filenames it finds in the otherDir directory that you switched to).


-jr
__________________
www.creativyst.com
Explored - Designed - Delivered(sm)

Last edited by JRepici : 10-23-2003 at 04:52 PM.
JRepici is offline  


Currently Active Users Viewing This Thread: 1 (0 members and 1 visitors)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 03:18 AM.


Running on vBulletin®
Copyright © 2000 - 2010, Jelsoft Enterprises Ltd.
Hosted & Administrated by FutureQuest, Inc.
Images & content copyright © 1998-2010 FutureQuest, Inc.
FutureQuest, Inc.