Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def _sync(self):
self.logger.error(
f"Source {self.source_real} is not a directory or doesn't exist! Quitting"
)
quit()
raise Exception(f"Source {self.source_real} is not a directory or doesn't exist")

if os.path.commonpath([self.source_real, self.replica_real]) in [
self.source_real,
Expand All @@ -82,7 +82,7 @@ def _sync(self):
self.logger.error(
f"Replica {self.replica_real} or source {self.source_real} is relative to the other! Quitting"
)
quit()
raise Exception(f"Replica {self.replica_real} or source {self.source_real} is relative to the other")

self.logger.info("Syncing...")

Expand All @@ -94,7 +94,7 @@ def _sync(self):
self.logger.error(
f"Replica {self.replica_real} exists, but is not a directory! Quitting"
)
quit()
raise Exception(f"Replica {self.replica_real} exists, but is not a directory")

else:
raise e
Expand Down Expand Up @@ -586,7 +586,7 @@ def main():
args = parser.parse_args()
except argparse.ArgumentError:
parser.print_help()
quit()
return

logger = logging.getLogger(__name__)

Expand All @@ -606,10 +606,10 @@ def main():

if args.interval_seconds < 0:
logger.error("Interval must be positive!")
quit()
return
if args.count < 0:
logger.error("Count must be a positive integer!")
quit()
return

if not os.chmod in os.supports_follow_symlinks:
logger.warning("Cannot modify permission bits of symlinks")
Expand All @@ -634,6 +634,10 @@ def main():
syncer.run()
except KeyboardInterrupt:
logger.error(f"Interrupted, task unfinished")
return
except Exception as e:
logger.error(f"Exception received, quitting! E: {e}")
return


if __name__ == "__main__":
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "folder-syncer"
version = "1.1.1.dev2"
version = "1.1.2a1"
description = "Folder syncer for Veeam technical assessment"
readme = "README.md"
authors = [
Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.