简体   繁体   中英

Cannot run crontab on Redhat

I have .sh file on redhat to run a crontab. Content of this file

#!/bin/bash

echo "run every 1min..."

I run it with the command:

[root@localhost ~]# * * * * * /var/www/html/ac/bc/1.sh
bash: anaconda-ks.cfg: command not found

The cron configuration rule is not a shell command (although it ends with one).

You have to enter it into your cron configuration, not enter it at the command prompt.

Run crontab -e to edit your cron configuration.

type

  crontab -e

press i

paste the line

* * * * * /var/www/html/ac/bc/1.sh

next save crontab

press

esc

type

:wq!

Type crontab -e then type your cron command. Then to save it press ESC and then press wq followed by enter .. Done.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM