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