R
Railway16mo ago
Kuyumee

OSError: [Errno 16] Device or resource busy: 'database'

I'm not able to shutil.rmtree("./Navi") then os.system("git clone https://github.com/Miriel-py/Navi.git"). I have a Volume that can help me with saving the database and it is on /app/Navi/database/
import re
import os
import shutil

print("Starting Navi...")
print("Current working directory: ", os.getcwd())


# Backup database from ./Navi/database to ./data
os.makedirs("./data", exist_ok=True)
if os.path.exists("./Navi/database/navi_db.db"):
shutil.copy("./Navi/database/navi_db.db", "./data/navi_db.db")
print("Database backup created successfully!")


# Clone github repo to Navi folder
print("Cloning Navi from github...")
shutil.rmtree("./Navi")
os.system("git clone https://github.com/Miriel-py/Navi.git")
print("Navi cloned successfully!")


# Copy database from ./data to ./Navi/database
if os.path.exists("./data/navi_db.db"):
shutil.copy("./data/navi_db.db", "./Navi/database/navi_db.db")
else:
os.rename("./Navi/database/default_db.db", "./Navi/database/navi_db.db")


# Install requirements and run bot
os.chdir("./Navi")
os.system("pip install -r requirements.txt")
os.system("python bot.py")
import re
import os
import shutil

print("Starting Navi...")
print("Current working directory: ", os.getcwd())


# Backup database from ./Navi/database to ./data
os.makedirs("./data", exist_ok=True)
if os.path.exists("./Navi/database/navi_db.db"):
shutil.copy("./Navi/database/navi_db.db", "./data/navi_db.db")
print("Database backup created successfully!")


# Clone github repo to Navi folder
print("Cloning Navi from github...")
shutil.rmtree("./Navi")
os.system("git clone https://github.com/Miriel-py/Navi.git")
print("Navi cloned successfully!")


# Copy database from ./data to ./Navi/database
if os.path.exists("./data/navi_db.db"):
shutil.copy("./data/navi_db.db", "./Navi/database/navi_db.db")
else:
os.rename("./Navi/database/default_db.db", "./Navi/database/navi_db.db")


# Install requirements and run bot
os.chdir("./Navi")
os.system("pip install -r requirements.txt")
os.system("python bot.py")
2 Replies
Percy
Percy16mo ago
Project ID: 39d0dd32-27a4-435b-96c1-07a268704727
Kuyumee
KuyumeeOP16mo ago
39d0dd32-27a4-435b-96c1-07a268704727
Want results from more Discord servers?
Add your server