403Webshell
Server IP : 216.92.14.13  /  Your IP : 216.73.216.171
Web Server : Apache
System : Linux vps4089.pairvps.com 5.15.0-190-generic #200-Ubuntu SMP Fri Aug 7 15:06:04 UTC 2026 x86_64
User : rmlac2fmr ( 1040637)
PHP Version : 8.2.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/home/rmlac2fmr/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/home/rmlac2fmr/backup_db.py
#!/usr/bin/env python3
"""
JBT Travel Ops — Database Backup
Creates a timestamped copy of db.json. Read-only operation — does not modify
the original. Safe to run anytime.
"""
import os
import sys
import shutil
from datetime import datetime

candidates = [
    'db.json',
    './data/db.json',
    os.path.expanduser('~/public_html/jn.com/ops/data/db.json')
]
db_path = next((c for c in candidates if os.path.exists(c)), None)
if not db_path:
    print("ERROR: Could not find db.json")
    sys.exit(1)

timestamp = datetime.now().strftime('%Y%m%d-%H%M%S')
backup_path = db_path + '.backup-' + timestamp

shutil.copy2(db_path, backup_path)

src_size = os.path.getsize(db_path)
bak_size = os.path.getsize(backup_path)

print(f"✓ Backup created")
print(f"  Source: {db_path}  ({src_size:,} bytes)")
print(f"  Backup: {backup_path}  ({bak_size:,} bytes)")

if src_size != bak_size:
    print(f"  ⚠ WARNING: sizes don't match — investigate before proceeding")
    sys.exit(1)

print(f"\nTo restore later if needed:")
print(f"  cp {backup_path} {db_path}")
print(f"  kill -9 `lsof -t -i :3000`")

Youez - 2016 - github.com/yon3zu
LinuXploit