Use the Linux at command in the Linux operating system to regularly send emails

Source: Internet
Author: User

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.

  1. Linux at command details and Use Cases
  2. Linux find command format and find command details
  3. Linux documentation-find command

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.