您现在的位置是:网站首页> 编程资料编程资料
centos 设置定时任务执行指定脚本的方法_linux shell_
2023-05-26
395人已围观
简介 centos 设置定时任务执行指定脚本的方法_linux shell_
vim /etc/crontab
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/
# For details see man 4 crontabs
# Example of job definition:
# .---------------- minute (0 - 59)
# | .------------- hour (0 - 23)
# | | .---------- day of month (1 - 31)
# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# | | | | |
# * * * * * user-name command to be executed
01 0 * * * root /data/backup/168/backup.sh
01 0 * * * root /data/backup/ty/backup.sh
vim /data/backup/168/backup.sh
rq=` date +%Y%m%d%H%M%S`
mysqldump etdsprodb -uroot > /data/backup/168/etdsprodb_$rq.sql
rq=` date +%Y%m%d%H%M%S`
mysqldump etdsreport -uroot > /data/backup/168/etdsreport_$rq.sql
rq=` date +%Y%m%d%H%M%S`
svnadmin dump /data/svnrepos/etds|gzip > /data/backup/168/svnetds_$rq.dump.tar.gz
以上这篇centos 设置定时任务执行指定脚本的方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持。
相关内容
- linux 使用NSF 映射远程磁盘目录的实现_linux shell_
- 虚拟机中使用linux系启用文件共享之后的文件存在的位置方法_linux shell_
- linux下passwd命令设置修改用户密码的方法_linux shell_
- 详解shell中>/dev/null 2>&1到底是什么_linux shell_
- fedora 23 lvm2格式 根目录磁盘空间不足 扩容方法_linux shell_
- 完美解决linux下dns配置重启失效的问题_linux shell_
- 修改Apache配置指定php配置文件php.ini的位置方法_linux shell_
- linux下开启php的sockets扩展支持实例_linux shell_
- Linux下netstat命令的一些常见用法_linux shell_
- linux bash脚本监控启动停止weblogic服务的脚本写法_linux shell_
