File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,24 @@ Creating a backup of the appliance will be done using SSH or the console.
15
15
16
16
3 . Save and/or rename ` /root/backup.tgz `
17
17
18
+ # Scheduling Database Backups
19
+ Scheduling a database backup using crontab and pg_dump.
20
+ This example will create a backup file in ` /tmp ` named something like ` db_dump20231009T145028.dump ` .
21
+ Before adding the cron job it would be best practice to mount an external storage and adjust the example accordingly.
22
+
23
+ 1 . SSH into the appliance and edit the root user crontab ` crontab -e `
24
+ 2 . Press ` i ` to insert and add a line with the desired schedule to run the backup job. Examples:
25
+ ``` bash
26
+ # Every hour on the hour
27
+ 0 * * * * pg_dump -Fc vmdb_production > /tmp/db_dump$( date +\% Y\% m\% dT\% H\% M\% S) .dump
28
+ # Every day at midnight
29
+ 0 0 * * * pg_dump -Fc vmdb_production > /tmp/db_dump$( date +\% Y\% m\% dT\% H\% M\% S) .dump
30
+ # Every week at midnight on Sunday
31
+ 0 0 * * 0 pg_dump -Fc vmdb_production > /tmp/db_dump$( date +\% Y\% m\% dT\% H\% M\% S) .dump
32
+ ```
33
+ 3 . Press ` Esc ` to exit insert mode then ` :wq ` and hit ` Enter ` to write and quit. If successful, it will output ` crontab: installing new crontab `
34
+ 4 . Done. If needed, logs can be found at ` /var/log/cron `
35
+
18
36
# Restore
19
37
Restoring a backup of the appliance will be done using SSH or the console.
20
38
You can’t perform that action at this time.
0 commit comments