Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 877
  • Last Modified:

Create tar backup from file list

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
matasimi
Asked:
matasimi
  • 2
1 Solution
 
nilayaksaCommented:
I think you can do with "tar cvf yourarchive.tar -l yourfilelist
0
 
Hugh FraserConsultantCommented:
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
 
matasimiAuthor Commented:
It is works!
Thank you!
Also I  found that tar command has an option "-T":
tar -cpf BackupFile.tar -T FolderAndFilesList.txt"

0
 
Hugh FraserConsultantCommented:
Well that's an even better solution. I'm ashamed I missed it.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now