I was hoping there was a way to have a list of “includes”, not just “excludes” within the Backup/Restore module. For example, I want to backup the /tftpboot/ directory, but ONLY the .xml and .cfg files.
My initial thought was to make it backup the directory “/tftpboot/*.xml”, but that didn’t seem to work. I’d hate to have to exclude everything else - is there any way to do it the way I’m wanting (just to list the file extensions of files to include)?
In the specific case of the /tftpboot directory, I’d think you’d want to back that up completely. If there’s anything in there that you don’t need, you should remove it from the directory… TFTP presents enough security risks on its face without adding the possibility of having files you don’t actually need being in the directory.
In the general case - backing up everything and excluding a few specific file types is a common way )some would argue, THE common way) to do this. I can’t think of a way to specify an inclusive list, but you can submit a Feature Request through the Issues tab and see what the developers are willing to do.
Well, off the top of my head, all the firmware bundles I don’t want to backup, and each model has different file Extensions. Dicko - that certainly does make it easier - thank you!
Question - the output, if I’m reading it right, equates to individual filenames, not directories (for example: anyfilename.grandstream or anyfilename.ringtones). Would it not actually be:
/digium
/firmwaredownloads
or something like that?
I ask because the backup is taking forever, when it should be relatively quick - even the phase where it makes the file is taking quite a bit of time.
for i in $(ls /tftpboot/digium/);do echo digium/.${i##.};done|sort -u |grep -Ev "xml|cfg"
for i in $(ls /tftpboot/firmware/);do echo firmware/.${i##.};done|sort -u |grep -Ev “xml|cfg”
but the firmware directory could probably be excluded en masse
So, if I understood the output correctly, my Exclusion list would look something like this? ======= digium/.* firmwaredownloads/.* grandstream/.* ringtones/.* sangoma/.* =======
Sorry, it’s just the exclusion syntax has always gotten the better of me…
Is there any way to basically say only do the folder mentioned in backup and exclude all nested folders/files? Meaning, it would do the root of the TFTPBOOT directory, but ignore all folders within that? That’s really what I’d want because as you add more brands to endpoint manager, it creates additional subdirectories that you’d have to call out as well.
So I just looked at the screenshot I took when I went to add that post - sure enough, it was star dot star (not star slash star) when I entered it. Working perfectly
One other question. I just found out that custom.conf files aren’t part of the normal backup/restore apparently (specifically when doing it for a warm standby, so I wanted to create a line item that captured them.
This is what I tried:
DIRECTORY = /etc/asterisk/custom.conf
and (also tried each one individually)
DIRECTORY = /etc/asterisk/*custom.conf
Instead, it grabbed all BUT the “custom” files. lol.