-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
23 lines (18 loc) · 924 Bytes
/
test.py
File metadata and controls
23 lines (18 loc) · 924 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from mongogbackup import MongoConfig, MongoGBackup
mongoConfig = MongoConfig(
db_name='test_db',
host='localhost',
port=27017,
)
backup_handler = MongoGBackup(
mongoConfig=mongoConfig,
credentials_file='credentials.json',
key='key'
)
# backup_handler.backups.backup(dir='output_path')
backup_handler.targz.pack(source_path='venv/', output_path='venv.tar.gz')
backup_handler.encrypt.encrypt_file('source.file', 'destination.file')
backup_handler.encrypt.decrypt_file('source.file', 'destination.file')
backup_handler.targz.unpack(source_path='venv.tar.gz', output_path='venv/')
backup_handler.backups.restore(bck_dir='output_path')
backup_handler.hash.generate_file_hash('source.file')