vim /etc/crontab
- 1 SHELL=/bin/bash
- 2 PATH=/sbin:/bin:/usr/sbin:/usr/bin
- 3 MAILTO=root
- 4 HOME=/
- 5
- 6 # For details see man 4 crontabs
- 7
- 8 # Example of job definition:
- 9 # .---------------- minute (0 - 59)
- 10 # | .------------- hour (0 - 23)
- 11 # | | .---------- day of month (1 - 31)
- 12 # | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
- 13 # | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
- 14 # | | | | |
- 15 # * * * * * user-name command to be executed
- 16
- 17 01 0 * * * root /data/backup/168/backup.sh
- 18 01 0 * * * root /data/backup/ty/backup.sh
1 SHELL=/bin/bash
2 PATH=/sbin:/bin:/usr/sbin:/usr/bin
3 MAILTO=root
4 HOME=/
5
6 # For details see man 4 crontabs
7
8 # Example of job definition:
9 # .---------------- minute (0 - 59)
10 # | .------------- hour (0 - 23)
11 # | | .---------- day of month (1 - 31)
12 # | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
13 # | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
14 # | | | | |
15 # * * * * * user-name command to be executed
16
17 01 0 * * * root /data/backup/168/backup.sh
18 01 0 * * * root /data/backup/ty/backup.sh
vim /data/backup/168/backup.sh
- 1 rq=` date +%Y%m%d%H%M%S`
- 2 mysqldump etdsprodb -uroot > /data/backup/168/etdsprodb_$rq.sql
- 3
- 4 rq=` date +%Y%m%d%H%M%S`
- 5 mysqldump etdsreport -uroot > /data/backup/168/etdsreport_$rq.sql
- 6
- 7 rq=` date +%Y%m%d%H%M%S`
- 8 svnadmin dump /data/svnrepos/etds|gzip > /data/backup/168/svnetds_$rq.dump.tar.gz