LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-03-2014, 03:04 AM   #16
_mz
Member
 
Registered: Jul 2013
Posts: 33

Original Poster
Rep: Reputation: Disabled

The --strip-components=NUMBER seems work with untar (tar -x) only like below:

# tar xvf error_in_20140903.tar.gz --strip-components=2

How to do the same for tar/archive (tar -c) in the script?
I tried "find $f -mtime +$max_days | tar cvzf $dest/$archive_file --strip-components=2 -T -" but not working
 
Old 09-03-2014, 03:31 AM   #17
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 9,432

Rep: Reputation: 2769Reputation: 2769Reputation: 2769Reputation: 2769Reputation: 2769Reputation: 2769Reputation: 2769Reputation: 2769Reputation: 2769Reputation: 2769Reputation: 2769
so you can use:
--transform=EXPRESSION, --xform=EXPRESSION use sed replace EXPRESSION to transform file names
maybe:
--transform=s/.interfaces.data.//
 
Old 09-03-2014, 04:44 AM   #18
_mz
Member
 
Registered: Jul 2013
Posts: 33

Original Poster
Rep: Reputation: Disabled
..deleted..

Last edited by _mz; 09-03-2014 at 04:45 AM. Reason: duplicate post
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] BASH read text list zip files into a single archive --possible? SilversleevesX Programming 9 03-10-2014 02:43 AM
[SOLVED] how to archive torrent file + the iso files , like the ova archive of virtual box jheengut Linux - Software 2 12-22-2013 05:04 PM
BASH: Unzip files/folders from archive one at a time using a loop cade Programming 3 05-16-2010 10:48 PM
Script to Add files to a Zip archive with out unzipping it !! prashix Programming 12 10-23-2007 09:19 AM
Automation Script !! Create automated archive of files based on name of file! yoshima Programming 5 09-28-2007 05:17 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:41 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration