I need to put together a bash script that will read in a text file containing a list of directories (one per line) and for each line output a separate archive (either zip archives or tarballs would be fine) of each directory, with the directory name (plus extension) as the filename.
So far I have the following, but need a way to read in the list of directories:
Any suggestions?
So far I have the following, but need a way to read in the list of directories:
Code:
for dirname in [LIST OF DIRECTORIES]
do
tar -czvf "backups/$dirname.tar.gz" "$dirname"
done
Any suggestions?