Not everything on a server is worth backing up (or the costs of backing up), for example log files, caches, and generated assets can be excluded. This reduces the backup size and the time it takes to create the backup while ensuring the things that actually matter, are regularly backed up.
When using the incremental backup script, I noticed some files were back-upped which should be backed up. In this case some logs files which I don't have to back up every day. So I changed the script to skip those files.
There are a few solutions for this. I could use grep with the -v parameter. This changes grep to filter instead of search.
For more information about grep, see the manpage of grep
But in this case, I was already using the find command. So I started searching if the find command itself has this functionality, which it did:
find /data/xxx -mtime -1 -type f -not -name "*.log"
This can be expanded with -name [pattern] to keep the files which match the pattern or filter the files which match the pattern with -not -name [pattern] .
For more information about find, see the manpage of find