mirror of
https://github.com/andwati/dokploy.git
synced 2026-11-12 06:55:19 +00:00
fix: change backup file naming to Windows-compatible format
This commit is contained in:
@@ -19,7 +19,8 @@ export const runComposeBackup = async (
|
|||||||
const project = await findProjectById(environment.projectId);
|
const project = await findProjectById(environment.projectId);
|
||||||
const { prefix, databaseType } = backup;
|
const { prefix, databaseType } = backup;
|
||||||
const destination = backup.destination;
|
const destination = backup.destination;
|
||||||
const backupFileName = `${new Date().toISOString()}.sql.gz`;
|
const timestamp = new Date().toISOString().replace('T', '_').replace(/:/g, '-').replace('.', '_');
|
||||||
|
const backupFileName = `${timestamp}.sql.gz`;
|
||||||
const bucketDestination = `${normalizeS3Path(prefix)}${backupFileName}`;
|
const bucketDestination = `${normalizeS3Path(prefix)}${backupFileName}`;
|
||||||
const deployment = await createDeploymentBackup({
|
const deployment = await createDeploymentBackup({
|
||||||
backupId: backup.backupId,
|
backupId: backup.backupId,
|
||||||
|
|||||||
@@ -19,7 +19,8 @@ export const runMariadbBackup = async (
|
|||||||
const project = await findProjectById(environment.projectId);
|
const project = await findProjectById(environment.projectId);
|
||||||
const { prefix } = backup;
|
const { prefix } = backup;
|
||||||
const destination = backup.destination;
|
const destination = backup.destination;
|
||||||
const backupFileName = `${new Date().toISOString()}.sql.gz`;
|
const timestamp = new Date().toISOString().replace('T', '_').replace(/:/g, '-').replace('.', '_');
|
||||||
|
const backupFileName = `${timestamp}.sql.gz`;
|
||||||
const bucketDestination = `${normalizeS3Path(prefix)}${backupFileName}`;
|
const bucketDestination = `${normalizeS3Path(prefix)}${backupFileName}`;
|
||||||
const deployment = await createDeploymentBackup({
|
const deployment = await createDeploymentBackup({
|
||||||
backupId: backup.backupId,
|
backupId: backup.backupId,
|
||||||
|
|||||||
@@ -16,7 +16,8 @@ export const runMongoBackup = async (mongo: Mongo, backup: BackupSchedule) => {
|
|||||||
const project = await findProjectById(environment.projectId);
|
const project = await findProjectById(environment.projectId);
|
||||||
const { prefix } = backup;
|
const { prefix } = backup;
|
||||||
const destination = backup.destination;
|
const destination = backup.destination;
|
||||||
const backupFileName = `${new Date().toISOString()}.sql.gz`;
|
const timestamp = new Date().toISOString().replace('T', '_').replace(/:/g, '-').replace('.', '_');
|
||||||
|
const backupFileName = `${timestamp}.sql.gz`;
|
||||||
const bucketDestination = `${normalizeS3Path(prefix)}${backupFileName}`;
|
const bucketDestination = `${normalizeS3Path(prefix)}${backupFileName}`;
|
||||||
const deployment = await createDeploymentBackup({
|
const deployment = await createDeploymentBackup({
|
||||||
backupId: backup.backupId,
|
backupId: backup.backupId,
|
||||||
|
|||||||
@@ -16,7 +16,8 @@ export const runMySqlBackup = async (mysql: MySql, backup: BackupSchedule) => {
|
|||||||
const project = await findProjectById(environment.projectId);
|
const project = await findProjectById(environment.projectId);
|
||||||
const { prefix } = backup;
|
const { prefix } = backup;
|
||||||
const destination = backup.destination;
|
const destination = backup.destination;
|
||||||
const backupFileName = `${new Date().toISOString()}.sql.gz`;
|
const timestamp = new Date().toISOString().replace('T', '_').replace(/:/g, '-').replace('.', '_');
|
||||||
|
const backupFileName = `${timestamp}.sql.gz`;
|
||||||
const bucketDestination = `${normalizeS3Path(prefix)}${backupFileName}`;
|
const bucketDestination = `${normalizeS3Path(prefix)}${backupFileName}`;
|
||||||
const deployment = await createDeploymentBackup({
|
const deployment = await createDeploymentBackup({
|
||||||
backupId: backup.backupId,
|
backupId: backup.backupId,
|
||||||
|
|||||||
@@ -25,7 +25,8 @@ export const runPostgresBackup = async (
|
|||||||
});
|
});
|
||||||
const { prefix } = backup;
|
const { prefix } = backup;
|
||||||
const destination = backup.destination;
|
const destination = backup.destination;
|
||||||
const backupFileName = `${new Date().toISOString()}.sql.gz`;
|
const timestamp = new Date().toISOString().replace('T', '_').replace(/:/g, '-').replace('.', '_');
|
||||||
|
const backupFileName = `${timestamp}.sql.gz`;
|
||||||
const bucketDestination = `${normalizeS3Path(prefix)}${backupFileName}`;
|
const bucketDestination = `${normalizeS3Path(prefix)}${backupFileName}`;
|
||||||
try {
|
try {
|
||||||
const rcloneFlags = getS3Credentials(destination);
|
const rcloneFlags = getS3Credentials(destination);
|
||||||
|
|||||||
@@ -12,7 +12,8 @@ export const backupVolume = async (
|
|||||||
volumeBackup.application?.serverId || volumeBackup.compose?.serverId;
|
volumeBackup.application?.serverId || volumeBackup.compose?.serverId;
|
||||||
const { VOLUME_BACKUPS_PATH } = paths(!!serverId);
|
const { VOLUME_BACKUPS_PATH } = paths(!!serverId);
|
||||||
const destination = volumeBackup.destination;
|
const destination = volumeBackup.destination;
|
||||||
const backupFileName = `${volumeName}-${new Date().toISOString()}.tar`;
|
const timestamp = new Date().toISOString().replace('T', '_').replace(/:/g, '-').replace('.', '_');
|
||||||
|
const backupFileName = `${volumeName}-${timestamp}.tar`;
|
||||||
const bucketDestination = `${normalizeS3Path(prefix)}${backupFileName}`;
|
const bucketDestination = `${normalizeS3Path(prefix)}${backupFileName}`;
|
||||||
const rcloneFlags = getS3Credentials(volumeBackup.destination);
|
const rcloneFlags = getS3Credentials(volumeBackup.destination);
|
||||||
const rcloneDestination = `:s3:${destination.bucket}/${bucketDestination}`;
|
const rcloneDestination = `:s3:${destination.bucket}/${bucketDestination}`;
|
||||||
|
|||||||
Reference in New Issue
Block a user