Sudo crontab -e vs crontab -e running command as sudo
Solution 1:
Of course, it is better to run a command that needs to be run as root from the crontab of the root user.
Running a command with sudo
in the user's crontab can technically work, but will require you implement a way to supply the sudo
password to that command: you will create issues with security.