Removed ownership for ftpdata folder
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 16s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 19s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 19s
Laravel Pint / pint (pull_request) Successful in 3m45s
Laravel Larastan / larastan (pull_request) Failing after 5m28s

This commit is contained in:
dhanabalan
2026-11-10 14:50:26 +05:30
parent 6eda73b4e1
commit 82306b16fc

View File

@@ -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) {