#!/bin/bash
#날짜
date=$(date '+%Y%m%d')
# 디렉토리 비우기
/usr/bin/rm -f /volume1/Distribute/table.tar.gz
/usr/bin/rm -rf /volume1/Distribute/table/*
# 디렉토리 복사
/usr/bin/cp -r /volume2/development/table/* /volume1/Distribute/table/
# Database sql dump
/volume1/@appstore/MariaDB10/usr/local/mariadb10/bin/mysqldump -uUSER -pPASSWORD table > /volume1/Distribute/table/table.sql
# 불필요 디렉토기 삭제
/usr/bin/rm -rf "/volume1/Distribute/table/_"
/usr/bin/rm -rf "/volume1/Distribute/table/프로젝트"
# 디렉토리 생성
/usr/bin/mkdir /volume1/Distribute/table/upload
/usr/bin/chown user:users /volume1/Distribute/table/*
/usr/bin/chmod 777 /volume1/Distribute/table/upload
# 파일 압축
/usr/bin/tar -zcvf /volume1/Distribute/table.tar.gz /volume1/Distribute/table/*