如何在其自己的Exec-Host挂钩中使用DDEV命令进行自动备份
我已经对我的DDEV进行了自定义命令,并使用一个命令创建数据库备份(是的,我很懒,对不起)。
我在想是否有某种方法可以连接DDEV命令,例如DDEV PowerOff将另一个命令或命令序列一起运行。
当我运行DDEV PowerOff时,想法是在特定目录中对所有数据库进行备份。
有人知道这一点吗?
谢谢
I've made a custom command to my ddev, creating a database backup with a single command (yes, I'm lazy, sorry).
I was thinking if there's some way to hook a ddev command, e.g. ddev poweroff to run another command or command sequence together.
The idea is to make a backup of all databases in a specific directory when I run the ddev poweroff.
Anyone have a clue about it?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当然,
预停机
exec-host
挂钩可以直接调用DDEV。这是一个既可以使用快照和传统DB转储的hook的示例:有关钩子的更多信息,请参见 ddev钩文档。
希望有帮助!
Sure,
pre-stop
exec-host
hooks can invoke ddev directly. Here's an example of a pre-stop hook that does both a snapshot and a traditional db dump:For more info on hooks, see DDEV hook docs.
Hope that helps!