About linux scheduled startup and execution of shell scripts
Source: Internet
Author: User
For details about how to regularly start and execute shell scripts in linux-general Linux technology-Linux technology and application information, see the following. I recently asked linux to execute a script for a while, but I have encountered some problems during the implementation process ~
I used EDIT: crontab-e.
--------------------------------------------------
SHELL =/bin/bash
PATH =/sbin:/bin:/usr/sbin:/usr/bin
HOME =/
13 22 *** root/software/ttsh
14 22 *** echo "Have a break now ."
--------------------------------------------------
Ttsh: the script is as follows:
--------------------------------------------------
#! /Bin/sh
Testa = "hello"
C_time = $ (date + % Y % m % d "" % H % M % S)
Echo "this is" $ testa $ c_time> & gt; 123456
Echo & quot; 111 & quot"
--------------------------------------------------
After each modification, perform the service crond restart operation.
Result: The task is not executed.
You have new mail in/var/spool/mail/root ):
Display:
Message-Id: <200911280822.nAS8M1qg003478@localhost.localdomain>
From: root@localhost.localdomain (Cron Daemon)
To: root@localhost.localdomain
Subject: Cron Root/software/ttsh
X-Cron-Env:
X-Cron-Env:
X-Cron-Env:
X-Cron-Env:
X-Cron-Env:
/Bin/bash: line 1: root: command not found
I wonder if anyone has encountered such a problem ~
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