I am building a script to back-up files and directories in my linux. These backups are stored in the map Archive.
Now i use in my source a specific directory but i have e.g.
input.txt with these directories:
/Downloads
/etc/var
or also with specific files
/etc/log/test.txt
Using /Downloads or /etc/var it must also backup the subdirectories of these directories. E.g. /Downloads has 3 other directories /dir1,/dir2,/dir3 these need to be archived also.
How can i use that file input.txt as source? Of the whole input.txt file I have to make 1 archive.
#!/bin/sh
source="/Downloads"
archive="example.tgz"
dest="Archive"
path="input.txt"
tar czf $dest/$archive $source
ls $dest
#this is how i read my file
while read line
do
echo $line
done < $path