Friday, July 15, 2016

Linux: How to tar only selected folders and files

Step 1: Select the files and prepare a list.

I do this with a simple function in my .bashrc script:

$> cat >> ~/.bashrc
99 function cscopesetup()
100 {
101     rm cscope.files;
102
103     echo "Populating filenames...";
104     find $SRC/folder1/ -iname "*.c" -print >> cscope.files #folder1
105     find $SRC/folder9/ -iname "*.h" -print >> cscope.files #folder9
106     echo "Driver done"
107 }

ctrl-D

Run this from the bash command:
$> source ~/.bashrc

This will create a file on your home directory with the name cscope.files

If you open this file, you should see the names of all the files you want to tar and backup.

Step 2: Now tar the files
$> tar -cvf myfile.tar -T cscope.files

This will do it.

9 comments:

Anonymous said...

Very useful for selective backup of files! Thanks.

Mailey Sirus 2 said...

24's Aljamain Sterling: I let fans, media coordinate style in 2 Profoundly Cited-MMAjunkie.com-19 hours earlier. Dana White: McGregor versus Mayweather is 'one and done,' no more. All the talk about UFC lightweight champion Conor McGregor going up against multi-time champion Floyd Mayweather has stirred up a couple of other.
UFC 210
UFC 210 Live , UFC 210 Fight Card , UFC 210 Fight , UFC 210 Card , UFC 210 Live Stream , UFC 210 PPV



"Disorder" Miller admits to around dozen. The past UFC middleweight yielded to just about twelve legal offenses and wrongdoings beginning from various clashes with police over. UFC on FOX 24: Aljamain Sterling let fans and media play into his. Sterling will want to end his slide when he goes up against Augusto Mendes at UFC on FOX 24 on April 15 in Kansas City, Mo. Additionally, you can trust.
UFC 210
UFC 210 Live , UFC 210 Fight Card , UFC 210 Fight , UFC 210 Card , UFC 210 Live Stream , UFC 210 PPV

SRUN POR said...

Thanks for this blog.
gclub casino
goldenslot
Gclub จีคลับ

Super Bowl 2018 said...

Watch Super Bowl 2018 Live Stream HD Online Here:

Super Bowl 2018
Super Bowl 2018 Tickets
Super Bowl Tickets
Super Bowl 2018 Live
Super Bowl 2018 Live Stream
Super Bowl 52
Super Bowl 52 Tickets
Super Bowl 52 Live
Super Bowl 52 Live Stream
Super Bowl LII
Super Bowl LII Tickets
Super Bowl LII Live
Super Bowl LII Live Stream

Winter Olympics said...

Watch Winter Olympics 2018 Live Stream HD Online Here:

Winter Olympics 2018
Winter Olympics 2018 Live
Winter Olympics 2018 Live Stream

Elton John Tour 2018 said...

Buy Elton John Tour 2018 Best Tickets Here:

Elton John Tour
Elton John Tour 2018
Elton John Tour Tickets
Elton John Tour 2018 Tickets

Khan Roni said...

Watch Daytona 500 Live Stream HD Online Here:

Daytona 500
Daytona 500
Daytona 500
Daytona 500
Daytona 500
Daytona 500
Daytona 500
Daytona 500
Daytona 500
Daytona 500
Daytona 500
Daytona 500
Daytona 500
Daytona 500

D2 Bet said...

"Disorder" Miller admits to around dozen.


สมัคร D2BET

Unknown said...

TCU Football
TCU Horned Frogs

USC Football
USC Trojans

Michigan State Football
Michigan State Spartans

UCF Football
UCF Knights

Penn State Football
Penn State Nittany Lions

Stanford Football
Stanford Cardinal

Ole Miss Football
Ole Miss Rebels

Wisconsin Football
Wisconsin Badgers

Post a Comment