Delete old files

This commit is contained in:
Mikhail Gordeev 2019-12-04 17:10:40 +03:00
parent 2702fb96f4
commit 81a068f1db

View File

@ -7,7 +7,6 @@ import argparse
import contextlib
import datetime
import fcntl
import glob
import logging
import os
import re
@ -541,8 +540,13 @@ Dir::Etc::preferencesparts "/var/empty";
def sync(self) -> None:
for branch in self.branches:
remote = self.remote(branch)
files = glob.glob(f'{self.images_dir}/{branch}/*')
cmd = ['rsync', '-v'] + files + [remote]
cmd = [
'rsync',
f'{self.images_dir}/{branch}/',
'-rv',
'--delete',
remote,
]
self.call(cmd)
self.kick()