Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit44ac5f4

Browse files
committed
Hide not reliable options: --check, --keep-data-generations, --keep-data-days
1 parentc1f1627 commit44ac5f4

File tree

5 files changed

+41
-51
lines changed

5 files changed

+41
-51
lines changed

‎doc/pg_arman.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,11 @@ Parameters to connect PostgreSQL server.
311311
if the server wants a password. In some cases it is worth typing -W
312312
to avoid the extra connection attempt.
313313

314+
###DELETE OPTIONS
315+
316+
**--wal**:
317+
Remove unnecessary wal archives also.
318+
314319
###GLOBAL OPTIONS
315320

316321
**--help**:

‎expected/backup.out

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,6 @@
1414
0
1515
1
1616
3
17-
###### BACKUP COMMAND TEST-0004 ######
18-
###### full backup with keep-data-generations and keep-data-days ######
19-
0
20-
0
21-
0
22-
The number of existing full backups validated is greater than 2.
23-
OK. Let's try to test --keep-data-generations=1.
24-
9
25-
0
26-
Number of remaining full backups validated: 2
27-
Number of deleted backups : 0
28-
6
2917
###### BACKUP COMMAND TEST-0005 ######
3018
###### switch backup mode from page to full ######
3119
page-level backup without validated full backup

‎expected/option.out

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,13 @@ Usage:
1414
Common Options:
1515
-D, --pgdata=PATH location of the database storage area
1616
-B, --backup-path=PATH location of the backup storage area
17-
-c, --check show what would have been done
1817
-j, --threads=NUM num threads for backup and restore
1918
--progress show progress copy files
2019

2120
Backup options:
2221
-b, --backup-mode=MODE full,page,ptrack
2322
-C, --smooth-checkpoint do smooth checkpoint before backup
2423
--stream use stream for save/restore WAL during backup
25-
--keep-data-generations=N keep GENERATION of full data backup
26-
--keep-data-days=DAY keep enough data backup to recover to DAY days age
2724
--backup-pg-log start backup pg_log directory
2825
-S, --slot=SLOTNAME replication slot to use
2926

@@ -95,7 +92,7 @@ ERROR: invalid backup-mode ""
9592

9693
###### COMMAND OPTION TEST-0010 ######
9794
###### invalid value in pg_arman.ini ######
98-
ERROR: option--keep-data-generations should be a 32bit signed integer: 'TRUE'
95+
ERROR:invalidoption"KEEP_DATA_GENERATIONS"
9996
1
10097

10198
###### COMMAND OPTION TEST-0011 ######

‎pg_arman.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ static pgut_option options[] =
5858
{'s','D',"pgdata",&pgdata,SOURCE_ENV },
5959
{'s','B',"backup-path",&backup_path,SOURCE_ENV },
6060
/* common options */
61-
{'b','c',"check",&check },
61+
/*{ 'b', 'c', "check",&check },*/
6262
{'i','j',"threads",&num_threads },
6363
{'b',8,"stream",&stream_wal },
6464
{'b',11,"progress",&progress },
@@ -68,8 +68,8 @@ static pgut_option options[] =
6868
{'b','C',"smooth-checkpoint",&smooth_checkpoint,SOURCE_ENV },
6969
{'s','S',"slot",&replication_slot,SOURCE_ENV },
7070
/* options with only long name (keep-xxx) */
71-
{'i',1,"keep-data-generations",&keep_data_generations,SOURCE_ENV },
72-
{'i',2,"keep-data-days",&keep_data_days,SOURCE_ENV },
71+
/*{ 'i', 1, "keep-data-generations", &keep_data_generations, SOURCE_ENV },
72+
{ 'i', 2, "keep-data-days",&keep_data_days,SOURCE_ENV },*/
7373
/* restore options */
7474
{'s',3,"recovery-target-time",&target_time,SOURCE_ENV },
7575
{'s',4,"recovery-target-xid",&target_xid,SOURCE_ENV },
@@ -233,15 +233,15 @@ pgut_help(bool details)
233233
printf(_("\nCommon Options:\n"));
234234
printf(_(" -D, --pgdata=PATH location of the database storage area\n"));
235235
printf(_(" -B, --backup-path=PATH location of the backup storage area\n"));
236-
printf(_(" -c, --check show what would have been done\n"));
236+
/*printf(_(" -c, --check show what would have been done\n"));*/
237237
printf(_(" -j, --threads=NUM num threads for backup and restore\n"));
238238
printf(_(" --progress show progress copy files\n"));
239239
printf(_("\nBackup options:\n"));
240240
printf(_(" -b, --backup-mode=MODE full,page,ptrack\n"));
241241
printf(_(" -C, --smooth-checkpoint do smooth checkpoint before backup\n"));
242242
printf(_(" --stream use stream for save/restore WAL during backup\n"));
243-
printf(_(" --keep-data-generations=N keep GENERATION of full data backup\n"));
244-
printf(_(" --keep-data-days=DAY keep enough data backup to recover to DAY days age\n"));
243+
/*printf(_(" --keep-data-generations=N keep GENERATION of full data backup\n"));
244+
printf(_(" --keep-data-days=DAY keep enough data backup to recover to DAY days age\n"));*/
245245
printf(_(" --backup-pg-log start backup pg_log directory\n"));
246246
printf(_(" -S, --slot=SLOTNAME replication slot to use\n"));
247247
printf(_("\nRestore options:\n"));

‎sql/backup.sh

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -34,35 +34,35 @@ pg_arman show -B ${BACKUP_PATH} > ${TEST_BASE}/TEST-0003.log 2>&1
3434
grep -c OK${TEST_BASE}/TEST-0003.log
3535
grep OK${TEST_BASE}/TEST-0003.log| sed -e's@[^-]@@g'| wc -c| sed's/^ *//'
3636

37-
echo'###### BACKUP COMMAND TEST-0004 ######'
38-
echo'###### full backup with keep-data-generations and keep-data-days ######'
39-
init_catalog
40-
pg_arman backup -B${BACKUP_PATH} -b full -p${TEST_PGPORT} -d postgres --verbose>${TEST_BASE}/TEST-0004-run.log2>&1;echo$?
41-
pg_arman backup -B${BACKUP_PATH} -b full -p${TEST_PGPORT} -d postgres --verbose>>${TEST_BASE}/TEST-0004-run.log2>&1;echo$?
42-
pg_arman backup -B${BACKUP_PATH} -b full -p${TEST_PGPORT} -d postgres --verbose>>${TEST_BASE}/TEST-0004-run.log2>&1;echo$?
43-
pg_arman validate -B${BACKUP_PATH} --verbose>>${TEST_BASE}/TEST-0004-run.log2>&1
44-
pg_arman show -B${BACKUP_PATH}>${TEST_BASE}/TEST-0004-before.log2>&1
45-
NUM_OF_FULL_BACKUPS_BEFORE=`grep OK${TEST_BASE}/TEST-0004-before.log| grep FULL| wc -l| sed's/^ *//'`
46-
if [${NUM_OF_FULL_BACKUPS_BEFORE}-gt 2 ];then
47-
echo"The number of existing full backups validated is greater than 2."
48-
echo"OK. Let's try to test --keep-data-generations=1."
49-
else
50-
echo"The number of existing full backups validated is not greater than 2."
51-
echo"NG. There was something wrong in preparation of this test."
52-
pg_ctl stop -m immediate -D${PGDATA_PATH}> /dev/null2>&1
53-
exit 1
54-
fi
55-
# The actual value of NUM_OF_FULL_BACKUPS_BEFORE can vary on env, so commented out as default.
56-
#echo "Number of existing full backups validated: ${NUM_OF_FULL_BACKUPS_BEFORE}"
57-
grep OK${TEST_BASE}/TEST-0004-before.log| sed -e's@[^-]@@g'| wc -c| sed's/^ *//'
58-
pg_arman backup -B${BACKUP_PATH} -b full --keep-data-days=-1 --keep-data-generations=1 -p${TEST_PGPORT} -d postgres --verbose>${TEST_BASE}/TEST-0005-run.log2>&1;echo$?
59-
pg_arman validate -B${BACKUP_PATH} --verbose>>${TEST_BASE}/TEST-0005-run.log2>&1
60-
pg_arman show --show-all -B${BACKUP_PATH}>${TEST_BASE}/TEST-0004-after.log2>&1
61-
NUM_OF_FULL_BACKUPS_AFTER=`grep OK${TEST_BASE}/TEST-0004-after.log| grep FULL| wc -l| sed's/^ *//'`
62-
echo"Number of remaining full backups validated:${NUM_OF_FULL_BACKUPS_AFTER}"
63-
NUM_OF_DELETED_BACKUPS=`grep DELETED${TEST_BASE}/TEST-0004-after.log| wc -l| sed's/^ *//'`
64-
echo"Number of deleted backups :${NUM_OF_DELETED_BACKUPS}"
65-
grep OK${TEST_BASE}/TEST-0004-after.log| sed -e's@[^-]@@g'| wc -c| sed's/^ *//'
37+
#echo '###### BACKUP COMMAND TEST-0004 ######'
38+
#echo '###### full backup with keep-data-generations and keep-data-days ######'
39+
#init_catalog
40+
#pg_arman backup -B ${BACKUP_PATH} -b full -p ${TEST_PGPORT} -d postgres --verbose > ${TEST_BASE}/TEST-0004-run.log 2>&1;echo $?
41+
#pg_arman backup -B ${BACKUP_PATH} -b full -p ${TEST_PGPORT} -d postgres --verbose >> ${TEST_BASE}/TEST-0004-run.log 2>&1;echo $?
42+
#pg_arman backup -B ${BACKUP_PATH} -b full -p ${TEST_PGPORT} -d postgres --verbose >> ${TEST_BASE}/TEST-0004-run.log 2>&1;echo $?
43+
#pg_arman validate -B ${BACKUP_PATH} --verbose >> ${TEST_BASE}/TEST-0004-run.log 2>&1
44+
#pg_arman show -B ${BACKUP_PATH} > ${TEST_BASE}/TEST-0004-before.log 2>&1
45+
#NUM_OF_FULL_BACKUPS_BEFORE=`grep OK ${TEST_BASE}/TEST-0004-before.log | grep FULL | wc -l | sed 's/^ *//'`
46+
#if [ ${NUM_OF_FULL_BACKUPS_BEFORE} -gt 2 ] ; then
47+
#echo "The number of existing full backups validated is greater than 2."
48+
#echo "OK. Let's try to test --keep-data-generations=1."
49+
#else
50+
#echo "The number of existing full backups validated is not greater than 2."
51+
#echo "NG. There was something wrong in preparation of this test."
52+
#pg_ctl stop -m immediate -D ${PGDATA_PATH} > /dev/null 2>&1
53+
#exit 1
54+
#fi
55+
## The actual value of NUM_OF_FULL_BACKUPS_BEFORE can vary on env, so commented out as default.
56+
##echo "Number of existing full backups validated: ${NUM_OF_FULL_BACKUPS_BEFORE}"
57+
#grep OK ${TEST_BASE}/TEST-0004-before.log | sed -e 's@[^-]@@g' | wc -c | sed 's/^ *//'
58+
#pg_arman backup -B ${BACKUP_PATH} -b full --keep-data-days=-1 --keep-data-generations=1 -p ${TEST_PGPORT} -d postgres --verbose > ${TEST_BASE}/TEST-0005-run.log 2>&1;echo $?
59+
#pg_arman validate -B ${BACKUP_PATH} --verbose >> ${TEST_BASE}/TEST-0005-run.log 2>&1
60+
#pg_arman show --show-all -B ${BACKUP_PATH} > ${TEST_BASE}/TEST-0004-after.log 2>&1
61+
#NUM_OF_FULL_BACKUPS_AFTER=`grep OK ${TEST_BASE}/TEST-0004-after.log | grep FULL | wc -l | sed 's/^ *//'`
62+
#echo "Number of remaining full backups validated: ${NUM_OF_FULL_BACKUPS_AFTER}"
63+
#NUM_OF_DELETED_BACKUPS=`grep DELETED ${TEST_BASE}/TEST-0004-after.log | wc -l | sed 's/^ *//'`
64+
#echo "Number of deleted backups : ${NUM_OF_DELETED_BACKUPS}"
65+
#grep OK ${TEST_BASE}/TEST-0004-after.log | sed -e 's@[^-]@@g' | wc -c | sed 's/^ *//'
6666

6767
echo'###### BACKUP COMMAND TEST-0005 ######'
6868
echo'###### switch backup mode from page to full ######'

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp