day = 1
item = "backups_all_ 2021.01.08|15.25.30.tar.gz"
d="$(date +%Y-%m-%d -d "$day days ago")"
if [[ item =~ "backups_all_$d|*.tar.gz" ]]
then
echo "ok"
fi
#!/bin/bash
day=2
item="backups_all_2021-01-08|15.25.30.tar.gz"
d="$(date +%Y-%m-%d -d "$day days ago")"
if [[ $item =~ backups_all_$d|.*.tar.gz ]]; then
echo "ok"
fi