Commit 423a3f5
Fix glob pattern expansion in oc exec commands
Glob patterns were being expanded by the local shell instead of the
remote shell in the pod, causing "No backup files found" error.
Problem:
oc exec pod -- ls /backup/data/*_backup_*.sql.gz
# Pattern expanded locally (fails - files don't exist locally)
Solution:
oc exec pod -- sh -c 'ls /backup/data/*_backup_*.sql.gz'
# Pattern expanded remotely (works - files exist in pod)
Changes:
- Wrap ls commands with sh -c to ensure glob expansion in pod
- List backup files: sh -c 'ls -1 /backup/data/*_backup_*.sql.gz | grep -v grants'
- Verify matched files: sh -c "ls -1 ${RESTORE_PATTERN}"
- Apply to both playbook and helper script
This fixes the "No backup files found" error when files actually exist.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>1 parent 71a0883 commit 423a3f5
2 files changed
Lines changed: 60 additions & 30 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1034 | 1034 | | |
1035 | 1035 | | |
1036 | 1036 | | |
1037 | | - | |
| 1037 | + | |
| 1038 | + | |
1038 | 1039 | | |
1039 | 1040 | | |
1040 | 1041 | | |
1041 | | - | |
1042 | | - | |
1043 | | - | |
1044 | | - | |
1045 | | - | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
1046 | 1054 | | |
1047 | | - | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
1048 | 1058 | | |
1049 | 1059 | | |
1050 | 1060 | | |
1051 | 1061 | | |
1052 | 1062 | | |
1053 | 1063 | | |
1054 | 1064 | | |
1055 | | - | |
1056 | | - | |
| 1065 | + | |
| 1066 | + | |
1057 | 1067 | | |
1058 | 1068 | | |
1059 | 1069 | | |
| |||
1132 | 1142 | | |
1133 | 1143 | | |
1134 | 1144 | | |
1135 | | - | |
1136 | | - | |
1137 | | - | |
1138 | | - | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
1139 | 1148 | | |
1140 | | - | |
1141 | | - | |
| 1149 | + | |
| 1150 | + | |
1142 | 1151 | | |
1143 | 1152 | | |
1144 | 1153 | | |
1145 | | - | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
1146 | 1163 | | |
1147 | | - | |
1148 | 1164 | | |
1149 | 1165 | | |
1150 | 1166 | | |
| |||
1154 | 1170 | | |
1155 | 1171 | | |
1156 | 1172 | | |
1157 | | - | |
| 1173 | + | |
| 1174 | + | |
1158 | 1175 | | |
1159 | 1176 | | |
1160 | 1177 | | |
| |||
1180 | 1197 | | |
1181 | 1198 | | |
1182 | 1199 | | |
1183 | | - | |
| 1200 | + | |
| 1201 | + | |
1184 | 1202 | | |
1185 | 1203 | | |
1186 | 1204 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
81 | 94 | | |
82 | | - | |
83 | 95 | | |
84 | 96 | | |
85 | 97 | | |
| |||
99 | 111 | | |
100 | 112 | | |
101 | 113 | | |
102 | | - | |
| 114 | + | |
103 | 115 | | |
104 | 116 | | |
105 | 117 | | |
| |||
137 | 149 | | |
138 | 150 | | |
139 | 151 | | |
140 | | - | |
| 152 | + | |
141 | 153 | | |
142 | 154 | | |
143 | 155 | | |
| |||
0 commit comments