MCPcopy
hub / github.com/Dokploy/dokploy / getMongoSpecificCommand

Function getMongoSpecificCommand

packages/server/src/utils/restore/utils.ts:78–95  ·  view source on GitHub ↗
(
	rcloneCommand: string,
	restoreCommand: string,
	backupFile: string,
)

Source from the content-addressed store, hash-verified

76};
77
78const getMongoSpecificCommand = (
79 rcloneCommand: string,
80 restoreCommand: string,
81 backupFile: string,
82): string => {
83 const tempDir = "/tmp/dokploy-restore";
84 const fileName = backupFile.split("/").pop() || "backup.sql.gz";
85 const decompressedName = fileName.replace(".gz", "");
86 return `
87rm -rf ${tempDir} && \
88mkdir -p ${tempDir} && \
89${rcloneCommand} ${tempDir} && \
90cd ${tempDir} && \
91gunzip -f "${fileName}" && \
92${restoreCommand} < "${decompressedName}" && \
93rm -rf ${tempDir}
94 `;
95};
96
97interface RestoreOptions {
98 appName: string;

Callers 1

getRestoreCommandFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected