arbi9:/tmp>cat dbdump.sh
#!/usr/bin/sh
DIR="/tmp"
WEEK=`date +%w`
src_file="$DIR/db.dump" #"db.dump" is defined in dbdump.sql
tgt_file="$DIR/user_db.$WEEK.dump"
log_file="$DIR/dbdump$WEEK.log"
isql -c. -Ust -Pmanager << EOF
dump database user_db to '$tgt_file'
.
EOF
echo "DB DUMP END ==>$tgt_file"
# 최근 일주일 치 덤프만 보관한다.
#!/usr/bin/sh
DIR="/tmp"
WEEK=`date +%w`
src_file="$DIR/db.dump" #"db.dump" is defined in dbdump.sql
tgt_file="$DIR/user_db.$WEEK.dump"
log_file="$DIR/dbdump$WEEK.log"
isql -c. -Ust -Pmanager << EOF
dump database user_db to '$tgt_file'
.
EOF
echo "DB DUMP END ==>$tgt_file"
# 최근 일주일 치 덤프만 보관한다.