Is it save to put a command which includes a sudo command on the schedluer?

Viewed 32

Good morning,

I am working on a link between my Laravel file server and a sinology backup. The command I am using uses a sudo command to create and then disconnect the link. I want to know if I would be able to run this command from the scheduler.

Thanks

1 Answers

You can use for example (to run at midnight, every day):

0 0 * * * /path/to/your/command

This is a record you can add in cron of the user you use to run the command. Be aware cron have different environment so you should set all the variables you need.

Related