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

Function getRestoreCommand

packages/server/src/utils/restore/utils.ts:107–131  ·  view source on GitHub ↗
({
	appName,
	type,
	restoreType,
	credentials,
	serviceName,
	rcloneCommand,
	backupFile,
}: RestoreOptions)

Source from the content-addressed store, hash-verified

105}
106
107export const getRestoreCommand = ({
108 appName,
109 type,
110 restoreType,
111 credentials,
112 serviceName,
113 rcloneCommand,
114 backupFile,
115}: RestoreOptions) => {
116 const containerSearch = getComposeSearchCommand(
117 appName,
118 restoreType,
119 serviceName,
120 );
121 const restoreCommand = generateRestoreCommand(type, credentials);
122 let cmd = `CONTAINER_ID=$(${containerSearch})`;
123
124 if (type !== "mongo") {
125 cmd += ` && ${rcloneCommand} | ${restoreCommand}`;
126 } else {
127 cmd += ` && ${getMongoSpecificCommand(rcloneCommand, restoreCommand, backupFile || "")}`;
128 }
129
130 return cmd;
131};

Callers 5

restoreMySqlBackupFunction · 0.90
restoreMongoBackupFunction · 0.90
restoreComposeBackupFunction · 0.90
restorePostgresBackupFunction · 0.90
restoreMariadbBackupFunction · 0.90

Calls 3

getComposeSearchCommandFunction · 0.85
generateRestoreCommandFunction · 0.85
getMongoSpecificCommandFunction · 0.85

Tested by

no test coverage detected