Solved

Create tar backup from file list

Posted on 2010-11-23
4
858 Views
Last Modified: 2013-12-26
Hi,
 I have a text file with ~200 files and folders names and complete paths of files in Linux (Debian Lenny) system that I want to backup to .tar archive.

FolderAndFilesList.txt:
/etc/resolv.conf
/etc/init.d/xdaemon.sh
/opt/conf/

Which GUI o CLI software can I use to create backup archive like this:
tar -cpf /media/backups/BackupFile.tar xxxxunknownoption < FolderAndFilesList.txt

Thank you.
0
Comment
Question by:matasimi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 1

Expert Comment

by:nilayaksa
ID: 34198203
I think you can do with "tar cvf yourarchive.tar -l yourfilelist
0
 
LVL 12

Accepted Solution

by:
hfraser earned 500 total points
ID: 34198791
Create an empty archive file, and then do an update as in:

while read x; do tar -uvf test.tar $x; done <file.list

The -u switch will append to the archive any new or modified files. Starting with an empty archive (or at least one with a seed file) will record only the files listed in file.list.
0
 

Author Closing Comment

by:matasimi
ID: 34199985
It is works!
Thank you!
Also I  found that tar command has an option "-T":
tar -cpf BackupFile.tar -T FolderAndFilesList.txt"

0
 
LVL 12

Expert Comment

by:hfraser
ID: 34201784
Well that's an even better solution. I'm ashamed I missed it.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Utilizing an array to gracefully append to a list of EmailAddresses
This article shows how to use a free utility called 'Parkdale' to easily test the performance and benchmark any Hard Drive(s) installed in your computer. We also look at RAM Disks and their speed comparisons.
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This tutorial will walk an individual through the process of installing of Data Protection Manager on a server running Windows Server 2012 R2, including the prerequisites. Microsoft .Net 3.5 is required. To install this feature, go to Server Manager…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question