Browse Source

Backup prints some useful info.

master
Abrax 3 years ago
parent
commit
662d408359
2 changed files with 7 additions and 1 deletions
  1. 1
    0
      README.md
  2. 6
    1
      db_methods.py

+ 1
- 0
README.md View File

@@ -20,6 +20,7 @@ These changes take effect with version 0.3 so be ready to update your scripts!
* Help message now shows version. (issue #24)
* New command: `rl` is refresh + list
* New command: `ro` is refresh + open in browser
* `lizard b` now prints more useful output.

### 0.1.1


+ 6
- 1
db_methods.py View File

@@ -27,7 +27,12 @@ def backup_database():
"""Makes a copy of the current database."""

if os.path.exists(constants.orm_db_path):
shutil.copy(constants.orm_db_path, '{}.{}'.format(constants.orm_db_path, time_methods.timestamp_now()))
old_path = constants.orm_db_path
new_path = '{}.{}'.format(constants.orm_db_path, time_methods.timestamp_now())
print('Backing up database, {} will be the backup...'.format(new_path), end=' ')

shutil.copy(old_path, new_path)
print('Done!')
else:
print(constants.orm_db_path + " doesn't exist, doing nothing.")


Loading…
Cancel
Save