Crontab as another user Ubuntu

Sometimes you need to run commands as another user in order to avoid permission errors, you can run a crontab as another user with the following command

sudo crontab -u USER_RUNNER -e

Just change USER_RUNNER for an existent user on your system and it will run as that user.

And by the way, if you need some assistance on how to create the different values for your cron times, and how they are defined, this is a great tool.

https://crontab.guru/

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s