Reputation: 19
I have installed a bunch of packages through chimp from umVIRTLFS. It creates a files.txt for each installed package in the directory /var/log/ulfs-package/package_name/ and I want to create a tarball containing the files listed in the files.txt. So I want to run the command tar -zvcf package_name.tar.gz -T files.txt for each folder inside /var/log/ulfs-package.
Upvotes: 1
Views: 203
Reputation: 1280
Assuming all files.txt
files are contained within a corresponding package_name
directory:
ULFS=/var/log/ulfs-package
for package_name in ${ULFS}/*
do
if [ -d ${ULFS}/${package_name} ] && [ -f ${ULFS}/${package_name}/files.txt ]
then
tar -zvcf ${package_name}.tar.gz -T ${ULFS}/${package_name}/files.txt
fi
done
Upvotes: 1