I am having issues excluding a specific file from a squashfs. I want to be able to exclude all file types ending with *.db but have had no luck.
Whenever I run the mksquashfs command with the arguments to exclude the file, it always includes the file. I have tried many different variants of the command. My test script is below:
#!/bin/bash
OPT="-regex -e '*.db' "
echo -e "Creating squashfs..."
mksquashfs test test.package ${OPT}
echo "Ran the following command: mksquashfs pf test.package ${OPT}"
echo -e "Uncompressing squashfs..."
mkdir pf_post
unsquashfs -f -d test_post/ test.package
echo
read -p "press any key to continue..."
rm test.package
rm -r test_post
The tree of the test directory is below. Both instances of test.db should be excluded but it does not seem to work.
test
├── test
│ └── test.db
├── test.ab
├── test.cd
├── test.db
├── test.ef
├── test.gh
└── test.sh
Switching it to wildcard partially fixed it. That excluded the first .db file, but the second one a sub-directory deeper was not excluded. Is there a way to tell it to exclude all '.db' files and not just the first in the lowest directory? Below is the code that excluded the first file type. Both solutions still did not exclude the subdirectory '.db' files.
mksquashfs test test.package -wildcards -e '*.db'
mksquashfs test test.package -regex -e '\.db$'
Some of the above solutions were provided from the following link, but I hit a dead end where I was unable to exclude all of the '.db' files. https://askubuntu.com/questions/628585/mksquashfs-not-excluding-file