ossc-db / pg_rman

Backup and restore management tool for PostgreSQL
http://ossc-db.github.io/pg_rman/index.html
Other
476 stars 77 forks source link

add the restriction to the manual #220

Open huangfumingyue opened 2 years ago

huangfumingyue commented 2 years ago

When pg_rman backup with --keep-data-generations 0, All backup files will be deleted, including the current backup file. It is the correct behavior, but we need to careful, so we add this case to the manual as restrictions.

206

mikecaat commented 2 years ago

Thanks. Are --keep-data-days, --keep-arclog-days and --keep-srvlog-days the same behavior?

huangfumingyue commented 2 years ago

--keep-data-days, --keep-arclog-days and --keep-srvlog-days are not the same behavior. I test it.

・--keep-data-days

-bash-4.2$ pg_rman show
=====================================================================
 StartTime           EndTime              Mode    Size   TLI  Status
=====================================================================
2022-02-15 16:49:27  2022-02-15 16:49:53  FULL   558MB     1  DONE

-bash-4.2$ pg_rman backup -b full --keep-data-days=0
INFO: copying database files
INFO: copying archived WAL files
INFO: backup complete
INFO: Please execute 'pg_rman validate' to verify the files are correctly copied.
INFO: start deleting old backup (keep after = 2022-02-15 00:00:00)
INFO: does not include the backup just taken
INFO: backup "2022-02-15 16:49:27" should be kept
DETAIL: This is taken after "2022-02-15 00:00:00".
-bash-4.2$ ^C
-bash-4.2$ pg_rman show
=====================================================================
 StartTime           EndTime              Mode    Size   TLI  Status
=====================================================================
2022-02-15 16:50:56  2022-02-15 16:51:29  FULL   693MB     1  DONE
2022-02-15 16:49:27  2022-02-15 16:49:53  FULL   558MB     1  OK

・--keep-arclog-files

-bash-4.2$ cd arclog
-bash-4.2$ ls
00000001000000000000002B  000000010000000000000036
00000001000000000000002C  000000010000000000000037
00000001000000000000002D  000000010000000000000038
00000001000000000000002E  000000010000000000000039
00000001000000000000002F  00000001000000000000003A
000000010000000000000030  00000001000000000000003B
000000010000000000000031  00000001000000000000003C
000000010000000000000032  00000001000000000000003D
000000010000000000000033  000000010000000000000040
000000010000000000000034  000000010000000000000041
000000010000000000000035  000000010000000000000041.00000028.backup

-bash-4.2$ pg_rman backup -b full --keep-arclog-files=0
-bash-4.2$ cd arclog
-bash-4.2$ ls
000000010000000000000042  000000010000000000000043.00000028.backup
000000010000000000000043

・--keep-arclog-days

-bash-4.2$ pg_rman backup -b full --keep-arclog-days=0
-bash-4.2$ cd arclog
-bash-4.2$ ls
000000010000000000000044  000000010000000000000045.00000028.backup
000000010000000000000045