further changes to avoid directory bug
This commit is contained in:
parent
b6d74c9e5b
commit
6b203dc298
@ -8,6 +8,4 @@
|
||||
|
||||
##config file: server specifics
|
||||
|
||||
##python3 demo_mover.py config.json
|
||||
|
||||
##should be run with a .service triggered through a systemctl timer
|
||||
|
@ -21,6 +21,8 @@ def create_remote(config, settings):
|
||||
|
||||
def distribute_files(path_list, dest):
|
||||
for pathfile in path_list:
|
||||
if not str(pathfile).endswith('.dem'):
|
||||
continue
|
||||
log_msg = "uploading demo: " + str(pathfile)
|
||||
logging.info(log_msg)
|
||||
if not dest.put(pathfile, dest.path):
|
||||
|
@ -13,5 +13,6 @@ class local_dir_remote:
|
||||
|
||||
def delete_local(self, pathfile):
|
||||
with contextlib.suppress(FileNotFoundError):
|
||||
os.remove(pathfile)
|
||||
print('removed demo: ', pathfile)
|
||||
if str(pathfile).endswith('.dem'):
|
||||
os.remove(pathfile)
|
||||
print('removed demo: ', pathfile)
|
||||
|
@ -109,6 +109,8 @@ class sftp_remote:
|
||||
self.connect()
|
||||
for pathfile in source_files:
|
||||
pathfile = str(pathfile)
|
||||
if not pathfile.endswith('.dem'):
|
||||
continue
|
||||
filename = pathfile.split("/")[-1]
|
||||
pathfile = self.path + filename
|
||||
utime = self.sftp.stat(pathfile).st_mtime
|
||||
|
Loading…
Reference in New Issue
Block a user