Skip to content

Commit

Permalink
Create backup_data.py
Browse files Browse the repository at this point in the history
  • Loading branch information
KOSASIH authored Nov 26, 2024
1 parent 60405cf commit 6bca7a0
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions QuantumNexusProtocol/backup_data.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import shutil
import os
from datetime import datetime

def backup_data():
source_dir = "/path/to/blockchain/data"
backup_dir = f"/path/to/backup/{datetime.now().strftime('%Y%m%d_%H%M%S')}"

try:
shutil.copytree(source_dir, backup_dir)
print(f"Backup completed successfully to {backup_dir}.")
except Exception as e:
print("Error during backup:", e)

if __name__ == "__main__":
backup_data()

0 comments on commit 6bca7a0

Please sign in to comment.