Skip to content

支持创建、恢复备份 - #207

Merged
icyleaf merged 1 commit into
developfrom
feature/backup-support
May 22, 2020
Merged

支持创建、恢复备份#207
icyleaf merged 1 commit into
developfrom
feature/backup-support

Conversation

@icyleaf

@icyleaf icyleaf commented May 21, 2020

Copy link
Copy Markdown
Member

代码基本上复制的 gitlab 的代码,通过 rake 命令可以操作:

命令

创建备份

备份存放路径: public/backup

$ rails zealot:backup:create
2020-05-21 21:52:41 +0800 -- Dumping PostgreSQL database zealot_development ... [DONE]
2020-05-21 21:52:41 +0800 -- Dumping uploads data ... [DONE]
2020-05-21 21:52:43 +0800 -- Creating backup archive: 1590069163_2020_05_21_development_zealot_backup.tar ... [DONE]
2020-05-21 21:52:44 +0800 -- Deleting tmp directories ... 2020-05-21 21:52:44 +0800 -- Deleting old backups ... [DONE] (0 removed)

恢复备份

恢复如果已存在 uploads 上传的应用和调试文件会转移到 public/tmp/uploads.old.xxxx 目录内

$ rails zealot:backup:restore
2020-05-21 22:01:01 +0800 -- Unpacking backup ... [DONE]
2020-05-21 22:01:01 +0800 -- Restoring PostgreSQL database zealot_development ... [DONE]
2020-05-21 22:01:02 +0800 -- Restoring uploads data ... [DONE]
2020-05-21 22:01:02 +0800 -- Deleting tmp directories ... [DONE]
Restore task is done.

@icyleaf
icyleaf force-pushed the feature/backup-support branch from 788df0c to cebac0e Compare May 21, 2020 14:04
@icyleaf icyleaf added the dependencies Pull requests that update a dependency file label May 21, 2020
@icyleaf
icyleaf merged commit 64ef1d5 into develop May 22, 2020
@icyleaf
icyleaf deleted the feature/backup-support branch May 22, 2020 03:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant