We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@joonshin79 (Yoonsik Shin) 님이 작성한 게시글입니다. ---
#!/bin/bash
sourcePath=/var/www/ backupPath=/var/www/backup/ backupDate=$(date +%Y%m%d)
sourcePath=/var/www/
backupPath=/var/www/backup/
backupDate=$(date +%Y%m%d)
USERNAME=yona PASSWORD=DB패스워드 DATABASE=yona
USERNAME=yona
PASSWORD=DB패스워드
DATABASE=yona
cd $sourcePath tar -zcvf $backupDate'_'$DATABASE.tar.gz html mv $backupDate'_'$DATABASE.tar.gz $backupPath cd $backupPath
cd $sourcePath
tar -zcvf $backupDate'_'$DATABASE.tar.gz html
mv $backupDate'_'$DATABASE.tar.gz $backupPath
cd $backupPath
mysqldump -u$USERNAME -p$PASSWORD $DATABASE > $backupPath/$backupDate'_'$DATABASE.sql
# 5일까지만 보관 이전 파일들 삭제 find $backupPath* -mtime +5 -name "*backupDate*" -exec rm {} \;
# 5일까지만 보관 이전 파일들 삭제
find $backupPath* -mtime +5 -name "*backupDate*" -exec rm {} \;
The text was updated successfully, but these errors were encountered:
No branches or pull requests
@joonshin79 (Yoonsik Shin) 님이 작성한 게시글입니다.
---
아래 작성후 crontab 등록
#!/bin/bash
sourcePath=/var/www/
backupPath=/var/www/backup/
backupDate=$(date +%Y%m%d)
USERNAME=yona
PASSWORD=DB패스워드
DATABASE=yona
cd $sourcePath
tar -zcvf $backupDate'_'$DATABASE.tar.gz html
mv $backupDate'_'$DATABASE.tar.gz $backupPath
cd $backupPath
mysqldump -u$USERNAME -p$PASSWORD $DATABASE > $backupPath/$backupDate'_'$DATABASE.sql
# 5일까지만 보관 이전 파일들 삭제
find $backupPath* -mtime +5 -name "*backupDate*" -exec rm {} \;
The text was updated successfully, but these errors were encountered: