?
Solved

Create tar backup from file list

Posted on 2010-11-23
4
Medium Priority
?
863 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 2000 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

RHCE - Red Hat OpenStack Prep Course

This course will provide in-depth training so that students who currently hold the EX200 & EX210 certifications can sit for the EX310 exam. Students will learn how to deploy & manage a full Red Hat environment with Ceph block storage, & integrate Ceph into other OpenStack service

Question has a verified solution.

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

Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
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.:
To efficiently enable the rotation of USB drives for backups, storage pools need to be created. This way no matter which USB drive is installed, the backups will successfully write without any administrative intervention. Multiple USB devices need t…
Suggested Courses

752 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