Enables Ubuntu to be shut down at a specified time every day, edit/etc/crontab to add one and ensure that the crontab service runs. Then, run f1f2f3f4f5 [yourusername] sudo/sbin/halt to shut down at every day. The command is as follows: 3023 *** [yourusername] for the crontab service, set sudo/sbin/halt to auto start in service management in GUI.
To shut down Ubuntu at a specified time every day, edit/etc/crontab to add one and ensure the running of the crontab service.
F1 f2 f3 f4 f5 [yourusername] sudo/sbin/halt
Assume that the command to shut down at every day is as follows:
30 23 *** [yourusername] sudo/sbin/halt
As for the crontab service, set it to auto start in service management under GUI.
F1 indicates the minute, f2 indicates the hour, f3 indicates the day of the month, f4 indicates the month, and f5 indicates the day of the week. Program indicates the program to be executed.
When f1 is *, the program is executed every minute, when f2 is *, the program is executed every hour, and so on.
When f1 is a-B, it indicates that execution is performed from the minute a to the minute B. When f2 is a-B, it indicates that execution is performed from the hour a to the hour B, other analogy
When f1 is */n, the execution is performed every n minutes. If f2 is */n, the execution is performed every n hours.
When f1 is a, B, c ,... a, B, c ,... execute in minutes. f2 is a, B, c ,... a, B, c... execute in hours, and so on