I have a backup script that has this syntax "tar -czvf backup.tar.gz -T filelist" In this filelist, I'm listing folder to backup, but I also need to backup every file that has a given extension like "*.jpeg"
The file name are changing everyday, that's why I need to use a wildcard but it's not accepted in a file list.
Is there a workaround to make this work ?
Thanks !
The easiest solution I found is :
tar -czvf backup.tar.gz $(cat filelist)
Have you try using --wildcards ?
http://www.gnu.org/s/tar/manual/html_section/wildcards.html
Create a filelist.template that contains the static folders to always backup and then copy it to filelist each time and add in all the
.jpeg
files. Something like:you could also use a
find
command instead ofls
if you need*.jpeg
from a variety of locations.