sqlite: change path to paths
This commit is contained in:
@@ -911,14 +911,16 @@ async function backupSqlite(app, options) {
|
||||
|
||||
const volumeDataDir = await apps.getStorageDir(app);
|
||||
|
||||
const cmd = `sqlite3 ${options.path} ".dump"`;
|
||||
const runCmd = `docker run --rm --name=sqlite-${app.id} \
|
||||
--net cloudron \
|
||||
-v ${volumeDataDir}:/app/data \
|
||||
--label isCloudronManaged=true \
|
||||
--read-only -v /tmp -v /run ${infra.images.base} ${cmd} > ${dumpPath('sqlite', app.id)}`;
|
||||
for (const p of options.paths) {
|
||||
const cmd = `sqlite3 ${p} ".dump"`;
|
||||
const runCmd = `docker run --rm --name=sqlite-${app.id} \
|
||||
--net cloudron \
|
||||
-v ${volumeDataDir}:/app/data \
|
||||
--label isCloudronManaged=true \
|
||||
--read-only -v /tmp -v /run ${infra.images.base} ${cmd} > ${dumpPath('sqlite', app.id)}`;
|
||||
|
||||
await shell.bash(runCmd, { encoding: 'utf8' });
|
||||
await shell.bash(runCmd, { encoding: 'utf8' });
|
||||
}
|
||||
}
|
||||
|
||||
async function backupLocalStorage(app, options) {
|
||||
@@ -936,14 +938,16 @@ async function restoreSqlite(app, options) {
|
||||
|
||||
const volumeDataDir = await apps.getStorageDir(app);
|
||||
|
||||
const cmd = `sqlite3 ${options.path}`;
|
||||
const runCmd = `docker run --rm --name=sqlite-${app.id} \
|
||||
--net cloudron \
|
||||
-v ${volumeDataDir}:/app/data \
|
||||
--label isCloudronManaged=true \
|
||||
--read-only -v /tmp -v /run ${infra.images.base} ${cmd} < ${dumpPath('sqlite', app.id)}`;
|
||||
for (const p of options.paths) {
|
||||
const cmd = `sqlite3 ${p}`;
|
||||
const runCmd = `docker run --rm --name=sqlite-${app.id} \
|
||||
--net cloudron \
|
||||
-v ${volumeDataDir}:/app/data \
|
||||
--label isCloudronManaged=true \
|
||||
--read-only -v /tmp -v /run ${infra.images.base} ${cmd} < ${dumpPath('sqlite', app.id)}`;
|
||||
|
||||
await shell.bash(runCmd, { encoding: 'utf8' });
|
||||
await shell.bash(runCmd, { encoding: 'utf8' });
|
||||
}
|
||||
}
|
||||
|
||||
async function restoreLocalStorage(app, options) {
|
||||
|
||||
Reference in New Issue
Block a user