$vi back.sh
(새벽 5시 정각)
#!/bin/sh time=`date '+%Y%m%d%H%M'` etc="etc" cd / backup_path ="/backup_path/" cd $backup_path mysqldump -u[userid] -p[userpwd] [dbname] > "$time.sql" --default-character-set=latin1 --set-charset find /backup_path/* -mtime +5 -exec rm -f {} ';
$chmod 700 back.sh
$crontab -e
00 05 * * * /path/backup.sh
* --default-character-set=latin1 --set-charset 캐릭터셋 지정
'OS' 카테고리의 다른 글
html 본문내 쿼리가 많거나 html 코드의 양이 많을 경우. (0) | 2010.01.20 |
---|---|
Mysql 원격접속 (0) | 2009.11.18 |
vi 명령어 (0) | 2009.11.16 |
서버상에 두개의 아파치가 올라 왔을때 세션공유관련. (0) | 2009.11.16 |
HTTP 상태 코드 (0) | 2009.10.15 |