: cron이용에 대한 질문입니다.
: 대충 cron이용에 대한 것은 이해가 가거든요...
: 이렇게 cron을 이용할려는데 어떻게 해야 할까요...
: 정기적으로 작업을 하되...
: 예를 들면 백업을 한다고 가정할때요...백업한날짜.tar.gz
: 이런 식으로 백업을 받았으면 해서요...제가 초보라...어떻게 해야할지..
: 아시는 분 답변 주시면 감사하겠습니다....
:
: --
: 사라지는 것은 사람일 뿐이다.!!!
Shell Script 를 이용하셔야 겠네요.
잘하시는 분 많겠지만 뭐 아래정도 하시면 될것 같은데요
#!/bin/bash
LOCKFILE=/var/lock/abc_backup.lock
# the lockfile is not meant to be perfect, it's just in case the
# two makewhatis cron scripts get run close to each other to keep
# them from stepping on each other's toes. The worst that will
# happen is that they will temporarily corrupt the database...
[ -f $LOCKFILE ] && exit 0
touch $LOCKFILE
export DATE=`date +%Y%m%d`
tar cvfz /home/abc/.db/$DATE.tgz /usr/local/mysql/data/abcd
rm -f $LOCKFILE
exit 0
리눅스라면 /etc/cron.daily (맞나) 에 넣어주시고
아니시람 crontab -e 해서 등록해 주시면 되겠네요.--이 곳에 서명을 적어주십시오.
서명없슴