Archive folders and sub folders | Unix Linux Forums | UNIX for Dummies Questions & Answers

  Go Back    


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 !!

Archive folders and sub folders

UNIX for Dummies Questions & Answers


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 08-28-2013
cnrj cnrj is offline
Registered User
 
Join Date: Apr 2011
Last Activity: 2 October 2013, 5:57 AM EDT
Posts: 38
Thanks: 5
Thanked 0 Times in 0 Posts
Archive folders and sub folders

Hi

Can i archive folder and folders in with the tar command

My files are located in subfolders
Eg: Folder1/Folder1_1/*.pdf
Folder1/Folder1_2/*.pdf
Folder1/Folder1_3/*.pdf


so i would like to tar all the files in Folder1_1 and Folder1_2 only not Folder1_3 that should be done next month.

Thanks
Sponsored Links
    #2  
Old 08-28-2013
in2nix4life's Avatar
in2nix4life in2nix4life is offline
Registered User
 
Join Date: Oct 2007
Last Activity: 21 November 2014, 1:51 PM EST
Location: East Coast
Posts: 611
Thanks: 1
Thanked 176 Times in 162 Posts
Check the man page for the tar command. It includes an exclude option.
Sponsored Links
    #3  
Old 08-28-2013
vbe's Avatar
vbe vbe is offline Forum Staff  
Moderator
 
Join Date: Sep 2005
Last Activity: 22 November 2014, 3:38 PM EST
Location: Switzerland - GE
Posts: 5,919
Thanks: 165
Thanked 431 Times in 403 Posts
or just

Code:
tar -cvf folder1_1-2.tar  Folder1/Folder1_[12]/

Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Archive files to different target folders based on criteria kmsekhar Shell Programming and Scripting 2 08-30-2011 07:18 AM
Searching for folders/parent folders not files. Aussiemick UNIX for Dummies Questions & Answers 2 06-23-2011 11:56 PM
Archive different folders based on their names vilibit Shell Programming and Scripting 8 10-08-2010 03:49 AM
How to Archive Folders in T-Shell aegan UNIX for Dummies Questions & Answers 1 11-19-2008 01:36 PM
script to archive certain folders in a hierarchy medazinol Shell Programming and Scripting 3 04-28-2005 11:45 AM



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