How to set up scheduled tasks in a SUSE system?
In the SUSE system, you can use the crontab command to set up scheduled tasks. The following are the steps to set up scheduled tasks.
- Open the terminal window and use the following command to edit the scheduled task table for the current user:
crontab -e
- In the editor, add scheduled tasks in the following format:
* * * * * command
Five asterisks represent minutes, hours, dates, months, and weekdays respectively, with the command being the task to be executed at the scheduled time.
- Save and exit the editor, the system will automatically schedule the task.
- Use the following command to view the current user’s scheduled tasks:
crontab -l
- To delete a cron job, you can use the following command to edit the current user’s cron table and delete the corresponding line:
crontab -e
Please note:
- Please make sure the path of the command is correct, as the scheduled task runs without environment variables.
- The output of the command will be sent to the current user’s email. If you do not want to receive this output, you can add >/dev/null 2>&1 after the command in the scheduled task.