Sometimes it is necessary to notify others or do something on their own at some time. For those who read emails every day, sending emails is the safest. In Linux, it is easy to use the Linux at command with mail.
The Linux at command can run a program at a certain time, while mail can send a copy of the mail body stored in a text in the command line.
Linux at command:
1. better understand the emailtext, such as in email.txt.
2. Then write a script, such as run. sh.
#! /Usr/bin/bash
Mail-s "Title here"-c Address_CC Address_To <email.txt
3. Execute
At 0815am Jan 24
At>./run. sh
At> ^ D
Run. sh can be executed at 8: 15 am, Jan 24.
However, some servers limit the use of the at command, so there is a stupid way,
Add "speep time" at the beginning of run. sh and run. sh directly.
Time is an integer in seconds.
However, some servers will automatically log out when the terminal does not enter a period of time, so that some actions such as pwd and ls in the script can be performed from time to prevent this situation.
The preceding method uses the Linux at command to regularly send emails in the Linux operating system.
- Linux at command details and Use Cases
- Linux find command format and find command details
- Linux documentation-find command