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: 18 April 2014, 3:11 PM EDT
Location: East Coast
Posts: 562
Thanks: 0
Thanked 160 Times in 146 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: 17 April 2014, 3:54 AM EDT
Location: Switzerland - GE
Posts: 5,490
Thanks: 148
Thanked 362 Times in 339 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 06:18 AM
Searching for folders/parent folders not files. Aussiemick UNIX for Dummies Questions & Answers 2 06-23-2011 10:56 PM
Archive different folders based on their names vilibit Shell Programming and Scripting 8 10-08-2010 02:49 AM
How to Archive Folders in T-Shell aegan UNIX for Dummies Questions & Answers 1 11-19-2008 12:36 PM
script to archive certain folders in a hierarchy medazinol Shell Programming and Scripting 3 04-28-2005 10:45 AM



All times are GMT -4. The time now is 08:10 AM.