I'm building a script for my ubuntu server. the script creates a lot of files which works just fine, but now i come to a part where i need to add a line to the crontab of the root user.
If I do it manually i would type
sudo crontab -e -u root and edit it crontab, but i want to automate it for this server. In my script i use
cat <<'EOF' > /sample/of/a/location.php to create and fill files.
how do i do this for the crontab of the root user? I've read that the location is /var/spool/cron/crontabs/ but i am not supposed to edit them directly.
Can somebody help me out here?