Magento module named module-backup
having such feature.
You can add the directory which you would like to ignore in the following file.
<magento-root>\vendor\magento\module-backup\Helper\Data.php
Look for the method named getBackupIgnorePaths
in Data.php
After the below line:
$this->_filesystem->getDirectoryRead(DirectoryList::VAR_DIR)->getAbsolutePath('report'),
add below line of code and replace directory of your choice. I have assumed
<magento-root>\pub\large_image
directory.
$this->_filesystem->getDirectoryRead(DirectoryList::PUB)->getAbsolutePath('large_image'),
Take directory constants (DirectoryList::PUB
or DirectoryList::VAR_DIR
) from the <magento-root>\vendor\magento\framework\App\Filesystem\DirectoryList.php
As this is public function so you can make override by adding plugin into this. Do not make direct any changes in the vendor directory.