mirror of
https://hk.gh-proxy.com/https://github.com/CaptainCore/do.git
synced 2025-10-03 23:34:10 +08:00
👌 IMPROVE: Database import
This commit is contained in:
parent
0cd5369878
commit
a7e455ba76
1 changed files with 3 additions and 1 deletions
|
@ -156,7 +156,9 @@ function migrate_site() {
|
|||
cd "$home_directory"
|
||||
|
||||
# --- Database Migration ---
|
||||
local database; database=$(find "$restore_dir" -type f -name '*.sql' -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" ")
|
||||
local database
|
||||
database=$(find "$restore_dir" "$home_directory" -type f -name '*.sql' -print0 | xargs -0 stat -f '%m %N' | sort -n | tail -1 | cut -f2- -d" ")
|
||||
|
||||
if [[ -z "$database" || ! -f "$database" ]]; then
|
||||
echo "⚠️ Warning: No .sql file found in backup. Skipping database import.";
|
||||
else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue