The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
can anyone help with shell script command about searching word with grep command? aintour Shell Programming and Scripting 2 10-14-2009 04:51 PM
problem with output of find command being input to basename command... new_learner UNIX for Dummies Questions & Answers 2 12-14-2008 02:56 AM
awk/sed Command : Parse parameter file / send the lines to the ksh export command rajan_san Shell Programming and Scripting 4 11-06-2008 01:29 PM
assign a command line argument and a unix command to awk variables sweta_doshi Shell Programming and Scripting 0 08-08-2008 06:54 AM
Help Required: Command to find IP address and command executed of a user loggedout Security 2 08-06-2008 08:12 PM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 1 Week Ago
killos killos is offline
Registered User
  
 

Join Date: Nov 2009
Posts: 5
Tar Command

Hello All,

I am currently in the process of BACKING UP over 160GB of data, where currently all files have been archived into directories, sub-directories and so fore by day, in the format for example
archive/data/2009-11-01
Or
archive/data/test/2009-11-01

The issue I’m having, is currently I need to backup by day (or by week), with the TAR command (I'm backing up onto disk via Sun Server), without dumping all the files for a day (or week) into a separate folder – and then backing up.

I’ve try using the following command:
Tar cv1 */2009-11-0[3-8] //first for week of November

Initially thought the wildcard (*) would back up all files in any directory named 2009-11-03 or 2009-11-04 from my current root directory ( ~archive/ )
But this command only back up all files that are a direct sub folder of the currently directory I’m in i.e.:

Archive/data/2009-11-03
Or
Archive/*/2009-11-04

And does not backup files that are in a further sub-directory (or more down) for example
Archive/data/DBA/2009-11-04
Or
Archive/*/*/*/2009-11-03

I've played about with scripting, but become stuck and reasoned it should be simpler I believe (???) – does anyone know an alteration or have any ideas to the above command that can help with my objective?
  #2 (permalink)  
Old 1 Week Ago
TonyLawrence TonyLawrence is offline
Registered User
  
 

Join Date: Sep 2007
Location: SE Mass
Posts: 133
Use "find" to get the list of files you want and tar from that list.
  #3 (permalink)  
Old 1 Week Ago
killos killos is offline
Registered User
  
 

Join Date: Nov 2009
Posts: 5
Previous I did the find step and created a list but the tar command doesnt work in the same way as copying would for example:

for i in `cat week1`; do cp -p $i /archive/data/backup; done // with week 1 being my list of files found using ' find ' -I can copy of the file to a directory with the same date stamp

But I'm unable to do a similar command for tar (keeping the name stamp) - continually getting syntax errors...



Sun Microsystems Inc. SunOS 5.9
Sponsored Links
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting 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
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 10:49 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0