mirror of
https://github.com/haiwen/seafile-server-installer-cn
synced 2024-09-20 08:15:28 +00:00
commit
57bd7f06c6
|
@ -60,4 +60,8 @@ bash seafile-server-ce-ubuntu-14-04-amd64-http 4.3.1
|
|||
```
|
||||
rm -rf /opt/seafile
|
||||
```
|
||||
### 备份 mysql
|
||||
|
||||
* 拷贝 `db-backup` 目录到 `/opt/seafile`
|
||||
* 修改 `db-backup/db_backup.sh` 中的 `USER` `PASSWD`
|
||||
* 执行 `crontab -e` 并添加内容 `0 1 * * * * /opt/seafile/db-backup/db_backup.sh` (每天凌晨1:00进行备份)
|
||||
|
|
3
db-backup/db-list.txt
Normal file
3
db-backup/db-list.txt
Normal file
|
@ -0,0 +1,3 @@
|
|||
ccnet-db
|
||||
seafile-db
|
||||
seahub-db
|
20
db-backup/db_backup.sh
Executable file
20
db-backup/db_backup.sh
Executable file
|
@ -0,0 +1,20 @@
|
|||
#!/bin/bash
|
||||
|
||||
USER=root
|
||||
PASSWD=aeneinoi
|
||||
DATE=`date +%Y%m%d%H%M`
|
||||
IGN_TAB=""
|
||||
|
||||
for ign_tab in `cat table-ignore.txt`;
|
||||
do
|
||||
IGN_TAB=${IGN_TAB}" --ignore-table=${ign_tab}"
|
||||
done
|
||||
|
||||
for DATABASE in `cat db-list.txt`;
|
||||
do
|
||||
mysqldump -u${USER} -p${PASSWD} --opt $DATABASE ${IGN_TAB} > $DATABASE-$DATE.sql
|
||||
done
|
||||
|
||||
# Compress and clean
|
||||
tar czvf mysql-back-$DATE.tar.gz *.sql
|
||||
rm -rf *.sql
|
11
db-backup/table-ignore.txt
Normal file
11
db-backup/table-ignore.txt
Normal file
|
@ -0,0 +1,11 @@
|
|||
seahub-db.avatar_uploaded
|
||||
seahub-db.avatar_avatar
|
||||
seahub-db.avatar_groupavatar
|
||||
seahub-db.Event
|
||||
seahub-db.FileAudit
|
||||
seahub-db.FileUpdate
|
||||
seahub-db.PermAudit
|
||||
seahub-db.UserEvent
|
||||
seahub-db.UserTrafficStat
|
||||
seahub-db.VirusFile
|
||||
seahub-db.VirusScanRecord
|
Loading…
Reference in New Issue
Block a user