The Linux operating system uses the Linuxat command 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, it is the safest to send emails, in Linux, use the Linuxat command in combination with the m command.

Sometimes it is necessary to notify others or do something on their own at some time. for those who read emails every day, it is the safest to send emails, 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 to run. sh and then run directly. sh to go to the background.

Time here is an integer, which refers to the number of seconds. However, when the terminal does not enter a period of time on some servers, the user will automatically log out, and some actions such as pwd can be performed in the script from time to time, ls and so on to prevent this situation. the above is the method to regularly send emails using the Linux at command in the Linux operating system.

Related Article

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.