- 论坛徽章:
- 0
|
回复 22# wenhq
当然有啊,这两个脚本的cron任务就是用ok988这个账户创建的- ok988@iotdemo:~$ crontab -l
- # Edit this file to introduce tasks to be run by cron.
- #
- # Each task to run has to be defined through a single line
- # indicating with different fields when the task will be run
- # and what command to run for the task
- #
- # To define the time you can provide concrete values for
- # minute (m), hour (h), day of month (dom), month (mon),
- # and day of week (dow) or use '*' in these fields (for 'any').#
- # Notice that tasks will be started based on the cron's system
- # daemon's notion of time and timezones.
- #
- # Output of the crontab jobs (including errors) is sent through
- # email to the user the crontab file belongs to (unless redirected).
- #
- # For example, you can run a backup of all your user accounts
- # at 5 a.m every week with:
- # 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
- #
- # For more information see the manual pages of crontab(5) and cron(8)
- #
- # m h dom mon dow command
- SHELL=/bin/bash
- PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
- #每天4:00执行mysql备份
- 0 4 * * * ~/mysql_backup/mysql_backup.sh
- #每6小时执行磁盘空间监测,超过预警给管理员发邮件
- 0 */6 * * * ~/monitor_disk.sh
- ok988@iotdemo:~$
复制代码 把/home/ok988权限改为755就OK了,怀疑是cron执行的时候并没有把执行账户换成当前的账户,造成了根本无法读取到脚本文件,提示not found |
|