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