Update sync_data.sh
Browse files- sync_data.sh +2 -2
sync_data.sh
CHANGED
@@ -126,8 +126,8 @@ options = {
|
|
126 |
client = Client(options)
|
127 |
backups = [file for file in client.list() if file.endswith('.tar.gz') and file.startswith('imageflow_backup_')]
|
128 |
backups.sort()
|
129 |
-
if len(backups) >
|
130 |
-
to_delete = len(backups) -
|
131 |
for file in backups[:to_delete]:
|
132 |
client.clean(file)
|
133 |
print(f'Successfully deleted {file}.')
|
|
|
126 |
client = Client(options)
|
127 |
backups = [file for file in client.list() if file.endswith('.tar.gz') and file.startswith('imageflow_backup_')]
|
128 |
backups.sort()
|
129 |
+
if len(backups) > 1:
|
130 |
+
to_delete = len(backups) - 1
|
131 |
for file in backups[:to_delete]:
|
132 |
client.clean(file)
|
133 |
print(f'Successfully deleted {file}.')
|