There are certain terminal commands which can only be run as a root user. If we try to execute them without
sudo keyword, they fail with the
Permission denied error. An example would be a command to make a directory/folder in certain locations.
I need to run one such command as a part of a cron job in my Ubuntu 16.04. Normally I could run the command with the
sudo keyword in the terminal and I would be prompted to enter the root user's password and then the command would be executed successfully.
But now that I have to enter this command as a part of a cron job in my
crontab file, how do I do this? How do I run such a command as a part of a cronjob?