- Implement backup #1

Merged
GuillaumeHemmen merged 2 commits from feat/implement-backup into master 2024-08-21 10:54:07 +00:00
Showing only changes of commit 8767af34a6 - Show all commits

- Remove redundant tar option in backup command

The `-z` option in the tar command was removed since it is unnecessary for the current backup operation. This simplifies the command and avoids potential confusion regarding compression.
Guillaume "B.B." Van Hemmen 2024-08-21 12:53:04 +02:00
Signed by: GuillaumeHemmen
GPG key ID: 7921E64524F7EB35

View file

@ -105,9 +105,7 @@ const runVolumeBackup = async (toolbox: Toolbox, workingDir: string, volumes: st
try { try {
spinner.start(`backing up volume ${volume}...`) spinner.start(`backing up volume ${volume}...`)
// improvement: display progress await system.run(`docker run --rm -v ${volume}:/volume -v ${workingDir}:/tmp alpine sh -c "cd /volume && tar -c -p -f /tmp/${volume}.tar ."`);
// see: https://superuser.com/questions/168749/is-there-a-way-to-see-any-tar-progress-per-file
await system.run(`docker run --rm -v ${volume}:/volume -v ${workingDir}:/tmp alpine sh -c "cd /volume && tar -z -c -p -f /tmp/${volume}.tar ."`);
spinner.succeed(`volume ${volume} backed up!`) spinner.succeed(`volume ${volume} backed up!`)
} catch (error) { } catch (error) {
@ -147,8 +145,6 @@ const command: GluegunCommand = {
print.success('Your volume have been backed up!') print.success('Your volume have been backed up!')
} else if (choice === 'Restore volumes') { } else if (choice === 'Restore volumes') {
// select the backup location folder // select the backup location folder
// @ts-ignore
const workingFolder = await getAndValidateBackupFolder(toolbox);
// list and select the archives to restore // list and select the archives to restore