At command usage
The at command allows a task to be executed at a specified time. Its common syntax structure is as follows:
At time, for example, at 2014-11-7 at, the execution result is sent to the user by email.
At now + number minutes | hours | days
At-l view all current at tasks
At-d number deletes a task.
Functions of the batch command
The batch command can also execute the corresponding task at a specified time. However, batch is executed only when the CPU load is less than 0.8. If the CPU is busy, the execution will be suspended.
Use of crontab
The at command is executed only once, but the crontab scheduled task can be executed cyclically at the specified time. The main command is crontab-e. This command will open the/etc/crontab file. In this file
* (Minute) * (hour) * (day) * (month) * (week) user cmd args if not specified, * indicates every minute, every hour, every day, every month, every person is a week.
Crontab-r can delete all scheduled tasks. To delete a specific task, you can use crontab-e to edit the/etc/crontab file.
4 linux work control.
When you run the following command, run cmd & run the command in the background. Or, press ctrl + z to transfer the program to the background for execution.
Fg transfers the most recent program to the background to the foreground for execution.
Fg % number transfers a job in the background to the foreground for execution.
Bg % number can be used to execute a job in the background. However, the execution result is still output on the current control terminal.
The foreground and background job control are related to the current control terminal. If you exit the control terminal, the job control becomes invalid. Use the nohup command if you want to disable the job control.
Nohup comd & when the program is executed in the background. If the user leaves the current console, job control is still in progress.
Review Notes 7