Skip to content

Commit

Permalink
Merge pull request #25 from d0ugal/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
d0ugal authored Oct 8, 2018
2 parents 8053173 + 2cd1f40 commit f055f52
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dropbox-upload/config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Dropbox Upload",
"version": "1.0.8",
"version": "1.0.9",
"slug": "dropbox_upload",
"description": "Upload snapshots to Dropbox!",
"startup": "application",
Expand Down
4 changes: 2 additions & 2 deletions dropbox-upload/dropbox_upload/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ def main(config_file, sleeper=time.sleep, DropboxAPI=dropbox.Dropbox):
stats = backup.backup(dbx, cfg, snapshots)
stats # make pyflakes think stats is used. It doesn't detect fstring usage.
LOG.info("Uploads complete")
LOG.info("Total size: {stats['size_human']}")
LOG.info(f"Total size: {stats['size_human']}")

limit.limit_snapshots(dbx, cfg, snapshots)
LOG.info("Snapshot cleanup complete")
except Exception:
LOG.exception("Unhandled error")

sleep = cfg.get("mins_between_backups", 10)
LOG.info("Sleeping for {sleep} minutes")
LOG.info(f"Sleeping for {sleep} minutes")
if sleeper(sleep * 60):
return

Expand Down
5 changes: 3 additions & 2 deletions dropbox-upload/dropbox_upload/backup.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,10 @@ def process_snapshot(config, dbx, snapshot):
bytes_ = os.path.getsize(path)
size = util.bytes_to_human(bytes_)
target = str(dropbox_path(config, snapshot))
LOG.info(f"Slug: {snapshot['slug']} Size: {size}")
LOG.debug(f"Slug: {snapshot['slug']}")
LOG.info(f"Size: {size}")
LOG.info(f"Created: {created}")
LOG.info(f"Uploading to: {target}")
LOG.debug(f"Uploading to: {target}")
try:
if dropbox.file_exists(dbx, path, target):
LOG.info("Already found in Dropbox with the same hash")
Expand Down

0 comments on commit f055f52

Please sign in to comment.