mirror of
https://github.com/postgrespro/pg_probackup.git
synced 2025-03-24 22:01:34 +02:00
Show progress messages with INFO verbose level
This commit is contained in:
parent
529173287f
commit
4ac0fab61b
10
src/delete.c
10
src/delete.c
@ -256,6 +256,7 @@ delete_backup_files(pgBackup *backup)
|
|||||||
char path[MAXPGPATH];
|
char path[MAXPGPATH];
|
||||||
char timestamp[100];
|
char timestamp[100];
|
||||||
parray *files;
|
parray *files;
|
||||||
|
size_t num_files;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If the backup was deleted already, there is nothing to do.
|
* If the backup was deleted already, there is nothing to do.
|
||||||
@ -286,13 +287,14 @@ delete_backup_files(pgBackup *backup)
|
|||||||
|
|
||||||
/* delete leaf node first */
|
/* delete leaf node first */
|
||||||
parray_qsort(files, pgFileComparePathDesc);
|
parray_qsort(files, pgFileComparePathDesc);
|
||||||
for (i = 0; i < parray_num(files); i++)
|
num_files = parray_num(files);
|
||||||
|
for (i = 0; i < num_files; i++)
|
||||||
{
|
{
|
||||||
pgFile *file = (pgFile *) parray_get(files, i);
|
pgFile *file = (pgFile *) parray_get(files, i);
|
||||||
|
|
||||||
/* print progress */
|
if (progress)
|
||||||
elog(VERBOSE, "Delete file(%zd/%lu) \"%s\"", i + 1,
|
elog(INFO, "Progress: (%zd/%zd). Process file \"%s\"",
|
||||||
(unsigned long) parray_num(files), file->path);
|
i + 1, num_files, file->path);
|
||||||
|
|
||||||
if (remove(file->path))
|
if (remove(file->path))
|
||||||
{
|
{
|
||||||
|
@ -385,7 +385,7 @@ merge_files(void *arg)
|
|||||||
elog(ERROR, "Interrupted during merging backups");
|
elog(ERROR, "Interrupted during merging backups");
|
||||||
|
|
||||||
if (progress)
|
if (progress)
|
||||||
elog(LOG, "Progress: (%d/%d). Process file \"%s\"",
|
elog(INFO, "Progress: (%d/%d). Process file \"%s\"",
|
||||||
i + 1, num_files, file->path);
|
i + 1, num_files, file->path);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -582,7 +582,7 @@ restore_files(void *arg)
|
|||||||
rel_path = GetRelativePath(file->path,from_root);
|
rel_path = GetRelativePath(file->path,from_root);
|
||||||
|
|
||||||
if (progress)
|
if (progress)
|
||||||
elog(LOG, "Progress: (%d/%lu). Process file %s ",
|
elog(INFO, "Progress: (%d/%lu). Process file %s ",
|
||||||
i + 1, (unsigned long) parray_num(arguments->files), rel_path);
|
i + 1, (unsigned long) parray_num(arguments->files), rel_path);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -156,9 +156,10 @@ pgBackupValidateFiles(void *arg)
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
validate_files_arg *arguments = (validate_files_arg *)arg;
|
validate_files_arg *arguments = (validate_files_arg *)arg;
|
||||||
|
int num_files = parray_num(arguments->files);
|
||||||
pg_crc32 crc;
|
pg_crc32 crc;
|
||||||
|
|
||||||
for (i = 0; i < parray_num(arguments->files); i++)
|
for (i = 0; i < num_files; i++)
|
||||||
{
|
{
|
||||||
struct stat st;
|
struct stat st;
|
||||||
pgFile *file = (pgFile *) parray_get(arguments->files, i);
|
pgFile *file = (pgFile *) parray_get(arguments->files, i);
|
||||||
@ -186,9 +187,9 @@ pgBackupValidateFiles(void *arg)
|
|||||||
if (file->is_cfs)
|
if (file->is_cfs)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* print progress */
|
if (progress)
|
||||||
elog(VERBOSE, "Validate files: (%d/%lu) %s",
|
elog(INFO, "Progress: (%d/%d). Process file \"%s\"",
|
||||||
i + 1, (unsigned long) parray_num(arguments->files), file->path);
|
i + 1, num_files, file->path);
|
||||||
|
|
||||||
if (stat(file->path, &st) == -1)
|
if (stat(file->path, &st) == -1)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user