File tree Expand file tree Collapse file tree 1 file changed +4
-24
lines changed Expand file tree Collapse file tree 1 file changed +4
-24
lines changed Original file line number Diff line number Diff line change @@ -12,41 +12,21 @@ echo "Using cronjob -> ${CRON_SCHEDULE}"
12
12
13
13
echo " Connecting to Minio 💾"
14
14
15
- # Capture command output and check for errors
16
- mcli_alias_output=$( mcli alias set myminio $MINIO_ENDPOINT $ACCESS_KEY $SECRET_KEY 2>&1 )
17
- if [[ $? -ne 0 ]]; then
18
- echo " Error connecting to Minio: $mcli_alias_output "
19
- exit 1
20
- fi
15
+ mcli alias set myminio $MINIO_ENDPOINT $ACCESS_KEY $SECRET_KEY
21
16
22
17
echo " Starting PostgreSQL database backup ⏳"
23
18
24
- # Capture timestamp generation and check for errors
25
- timestamp=$( date +" %m_%d_%Y_%H_%M_%S" 2>&1 )
26
- if [[ $? -ne 0 ]]; then
27
- echo " Error generating timestamp"
28
- exit 1
29
- fi
19
+ timestamp=$( date +" %m_%d_%Y_%H_%M_%S" )
30
20
31
21
filename=backup_${timestamp} .bak
32
22
33
- # Capture pg_dump output and check for errors
34
- pg_dump_output=$( pg_dump -Fc -v -d $DATABASE_URL -f $filename 2>&1 )
35
- if [[ $? -ne 0 ]]; then
36
- echo " Error during database backup: $pg_dump_output "
37
- exit 1
38
- fi
23
+ pg_dump -Fc -v -d $DATABASE_URL -f $filename
39
24
40
25
echo " Backup completed successfully 🎉"
41
26
42
27
echo " Uploading to Minio "
43
28
44
- # Capture mcli output and check for errors
45
- mcli_upload_output=$( mcli cp $filename myminio/${MINIO_BUCKET} 2>&1 )
46
- if [[ $? -ne 0 ]]; then
47
- echo " Error uploading to Minio: $mcli_upload_output "
48
- exit 1
49
- fi
29
+ mcli cp $filename myminio/${MINIO_BUCKET}
50
30
51
31
echo " Upload completed successfully 🎉"
52
32
You can’t perform that action at this time.
0 commit comments