I tried to create a cron file for updating Pi-hole according to the instructions. I used the command sudo systemctl status cron to check if the command was working, but I received the following error message:
Error: bad username; while reading /etc/cron.d/pihole-gravity-after-reboot
The error was likely caused by the missing username after the @reboot in the command. I determined the correct username using the whoami command and added it to the command as follows:
@reboot pi /usr/bin/sleep 300 && /usr/local/bin/pihole -g
After that, the cron file worked correctly, and Pi-hole was updated successfully after the reboot.