From 82306b16fc56a55d9bec4de340782f769fa840f3 Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Tue, 10 Nov 2026 14:50:26 +0530 Subject: [PATCH] Removed ownership for ftpdata folder --- app/Console/Commands/ProcessSftpFiles.php | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/app/Console/Commands/ProcessSftpFiles.php b/app/Console/Commands/ProcessSftpFiles.php index bff31ff3..6d2d2bb5 100644 --- a/app/Console/Commands/ProcessSftpFiles.php +++ b/app/Console/Commands/ProcessSftpFiles.php @@ -263,7 +263,6 @@ class ProcessSftpFiles extends Command $allFiles = []; $logMessages = []; - // Check whether data2 exists if (!File::isDirectory($basePath)) { $this->error("Directory not found: {$basePath}"); return; @@ -279,14 +278,12 @@ class ProcessSftpFiles extends Command File::makeDirectory($folderPath, 0755, true); - // Set ownership - exec("chown www-data:www-data " . escapeshellarg($folderPath)); + // exec("chown www-data:www-data " . escapeshellarg($folderPath)); $this->info("Created missing folder: {$folderName}"); } } - // Get plant folders: 1000, 1010, etc. $folders = File::directories($basePath); if (empty($folders)) { @@ -294,14 +291,12 @@ class ProcessSftpFiles extends Command return; } - // Collect TXT files from each plant folder foreach ($folders as $folderPath) { $folderName = basename($folderPath); Log::info("Checking plant folder: {$folderName}"); - // Get files inside the plant folder $files = File::files($folderPath); foreach ($files as $file) { @@ -324,7 +319,6 @@ class ProcessSftpFiles extends Command $dbColumns = Schema::getColumnListing('production_temps'); - // Process each TXT file foreach ($allFiles as $fileDetails) { $file = $fileDetails['path']; @@ -332,7 +326,6 @@ class ProcessSftpFiles extends Command $this->info("Processing file: {$file}"); - // Find plant using folder name $plant = Plant::where('code', $folderName)->first(); if (!$plant) {