Merge branch 'rename-file'
This commit is contained in:
commit
ef57d92615
23
README-FTP-USE
Normal file
23
README-FTP-USE
Normal file
@ -0,0 +1,23 @@
|
||||
Définition des dossiers
|
||||
=======================
|
||||
send : Client => SD
|
||||
recv : SD => Client
|
||||
|
||||
Création d'un utilisateur
|
||||
=========================
|
||||
pure-pw useradd [user] -u ftpuser -j -d [dir]
|
||||
|
||||
Modifier le mot de passe
|
||||
========================
|
||||
pure-pw passwd [user]
|
||||
|
||||
Modifier un utilisateur
|
||||
=======================
|
||||
pure-pw usermod [user] -d [newdir]
|
||||
|
||||
Supprimer un utilisateur
|
||||
========================
|
||||
pure-pw userdel [user]
|
||||
|
||||
|
||||
Note : Après chaque modification : pure-pw mkdb
|
17
README-SFTP-USE
Normal file
17
README-SFTP-USE
Normal file
@ -0,0 +1,17 @@
|
||||
Définition des dossiers
|
||||
=======================
|
||||
send : Client => SD
|
||||
recv : SD => Client
|
||||
|
||||
Création d'un utilisateur
|
||||
=========================
|
||||
|
||||
useradd -s /bin/false -g sftp -d /home/data/sftp/username username
|
||||
passwd username
|
||||
|
||||
Création du HOME
|
||||
================
|
||||
mkdir -p /home/data/sftp/username/{recv,send}
|
||||
chown username:sftp -R /home/data/sftp/username
|
||||
chmod -Rv 755 /home/data/sftp/username/
|
||||
chown root:root /home/data/sftp/username
|
@ -138,4 +138,27 @@ return array(
|
||||
),
|
||||
),
|
||||
),
|
||||
'effico' => array(
|
||||
'prestations' => array(
|
||||
array(
|
||||
'name' => 'DIFBODPRDSFTPEFFICO',
|
||||
'type' => 'SFTP',
|
||||
'in' => array(),
|
||||
'out' => array(),
|
||||
),
|
||||
),
|
||||
),
|
||||
'sofid' => array(
|
||||
'prestations' => array(
|
||||
array(
|
||||
'name' => 'SURBODPRDFTSSOFID',
|
||||
'type' => 'FTP',
|
||||
'in' => array(
|
||||
'Route' => array( 'cp' => '/home/data/clients-ftp/sofid/send' ),
|
||||
'CopyDeleteAfter' => true,
|
||||
),
|
||||
'out' => array(),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
@ -73,7 +73,7 @@ if ( isset($opts->file) )
|
||||
$fluxRepository = str_replace(array($fluxBasePath.'/', '/'.$filenameIn), array('', ''), $opts->file);
|
||||
|
||||
// --- Match prestation
|
||||
$prestations = include __DIR__ . '/fileConfig.php';
|
||||
$prestations = include __DIR__ . '/config.php';
|
||||
$prestation = null;
|
||||
if (array_key_exists($client, $prestations))
|
||||
{
|
@ -98,7 +98,7 @@ if ( $result->count() > 0 ) {
|
||||
$optionsLog = false;
|
||||
|
||||
// Match prestation
|
||||
$prestations = include __DIR__ . '/fileConfig.php';
|
||||
$prestations = include __DIR__ . '/config.php';
|
||||
$prestation = null;
|
||||
if (array_key_exists($item->client, $prestations))
|
||||
{
|
@ -1,58 +0,0 @@
|
||||
<?php
|
||||
// --- Define path to application directory
|
||||
defined('APPLICATION_PATH')
|
||||
|| define('APPLICATION_PATH', realpath(__DIR__ . '/../../application'));
|
||||
|
||||
// --- Define application environment
|
||||
defined('APPLICATION_ENV')
|
||||
|| define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));
|
||||
|
||||
// --- Composer autoload
|
||||
require_once realpath(__DIR__ . '/../../vendor/autoload.php');
|
||||
|
||||
try {
|
||||
$opts = new Zend_Console_Getopt(
|
||||
//Options
|
||||
array(
|
||||
'help|?' => "Display usage information.",
|
||||
'install=s' => "Make install operation.",
|
||||
)
|
||||
);
|
||||
$opts->parse();
|
||||
} catch (Zend_Console_Getopt_Exception $e) {
|
||||
echo $e->getUsageMessage();
|
||||
exit;
|
||||
}
|
||||
|
||||
//Usage
|
||||
if (isset($opts->help))
|
||||
{
|
||||
echo $opts->getUsageMessage();
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
if ( ! empty($opts->install) )
|
||||
{
|
||||
echo date('Y-m-d H:i:s')." - Démarrage de la configuration.\n";
|
||||
|
||||
//Copy configuration
|
||||
$configDir = realpath(dirname(__FILE__)).'/profil';
|
||||
$appconfigDir = APPLICATION_PATH.'/configs';
|
||||
$profil = $opts->install;
|
||||
|
||||
if ( !file_exists( $appconfigDir.'/application.ini') ) {
|
||||
$result = copy($configDir.'/'.$profil.'/application.ini', $appconfigDir.'/application.ini');
|
||||
if ($result !== true) {
|
||||
echo date('Y-m-d H:i:s')." - Impossible de copier la configuration.\n";
|
||||
exit(1);
|
||||
}
|
||||
} else {
|
||||
echo date('Y-m-d H:i:s')." - Le profil de configuration existe déja.\n";
|
||||
exit(1);
|
||||
}
|
||||
|
||||
echo date('Y-m-d H:i:s')." - Fin de la configuration.\n";
|
||||
} else {
|
||||
echo date('Y-m-d H:i:s')." - Je n'ai rien fait !\n";
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
|
||||
# Gestion des flux a envoyer au client
|
||||
*/15 4-18 * * * root php /home/flux/fileRecv.php --cron >> /home/log/recv.log 2>&1
|
||||
*/15 4-18 * * * root php /home/flux/current/recv.php --cron >> /home/log/recv.log 2>&1
|
||||
|
||||
# Nettoyage
|
||||
01 18 * * * root php /home/flux/fileClean.php --cron >> /home/log/clean.log 2>&1
|
||||
01 18 * * * root php /home/flux/current/clean.php --cron >> /home/log/clean.log 2>&1
|
@ -38,7 +38,7 @@ if(isset($opts->help))
|
||||
exit;
|
||||
}
|
||||
|
||||
$prestations = include APPLICATION_PATH . '/../fileConfig.php';
|
||||
$prestations = include APPLICATION_PATH . '/../config.php';
|
||||
|
||||
if ($opts->list)
|
||||
{
|
||||
@ -83,7 +83,7 @@ if ($opts->generate)
|
||||
}
|
||||
$fluxBasePath = '/home/data/' . strtolower($item['type']) . '/' . $client . '/' . $directory;
|
||||
$file = __DIR__ . '/incron.d/' . strtolower($item['type']) . '_' . $client;
|
||||
file_put_contents($file, "$fluxBasePath IN_CLOSE_WRITE php /home/batchFlux/fileSend.php --file $@/$# >> /home/log/send.log 2>&1");
|
||||
file_put_contents($file, "$fluxBasePath IN_CLOSE_WRITE php /home/flux/current/send.php --file $@/$# >> /home/log/send.log 2>&1");
|
||||
echo "File created $file\n";
|
||||
}
|
||||
}
|
||||
@ -109,7 +109,7 @@ if ($opts->generate)
|
||||
}
|
||||
$fluxBasePath = '/home/data/' . strtolower($item['type']) . '/' . $client. '/' . $directory;
|
||||
$file = __DIR__ . '/incron.d/' . strtolower($item['type']) . '_' . $client . '_recv';
|
||||
file_put_contents($file, "$fluxBasePath IN_ACCESS php /home/batchFlux/fileRead.php --file $@/$# >> /home/log/read.log 2>&1");
|
||||
file_put_contents($file, "$fluxBasePath IN_ACCESS php /home/flux/current/read.php --file $@/$# >> /home/log/read.log 2>&1");
|
||||
echo "File created $file\n";
|
||||
}
|
||||
}
|
||||
|
@ -1,43 +0,0 @@
|
||||
[production]
|
||||
phpSettings.date.timezone = "Europe/Paris"
|
||||
phpSettings.display_startup_errors = 0
|
||||
phpSettings.display_errors = 0
|
||||
bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
|
||||
bootstrap.class = "Bootstrap"
|
||||
appnamespace = "Application"
|
||||
resources.frontController.params.displayExceptions = 0
|
||||
resources.layout.layout = "main"
|
||||
resources.layout.layoutPath = APPLICATION_PATH "/views"
|
||||
resources.view.basePath = APPLICATION_PATH "/views"
|
||||
autoloaderNamespaces[] = "Application_"
|
||||
autoloaderNamespaces[] = "Scores_"
|
||||
autoloaderNamespaces[] = "Metier_"
|
||||
|
||||
; Scores configuration
|
||||
profil.path.data = "/home/data"
|
||||
profil.path.storage = "/home/data/clients"
|
||||
profil.path.ftp = "/home/data/ftp"
|
||||
profil.path.sftp = "/home/data/sftp"
|
||||
|
||||
; Database configuration
|
||||
profil.db.metier.adapter=mysqli
|
||||
profil.db.metier.params.host=192.168.3.28
|
||||
profil.db.metier.params.username=batchuser
|
||||
profil.db.metier.params.password=2XQTpKatBVRezXE9
|
||||
profil.db.metier.params.dbname=sdv1
|
||||
profil.db.metier.params.driver_options.MYSQLI_INIT_COMMAND = "SET NAMES utf8"
|
||||
|
||||
; Mail configuration
|
||||
profil.db.method = sendmail
|
||||
|
||||
[staging : production]
|
||||
resources.frontController.params.displayExceptions = 1
|
||||
|
||||
[development : production]
|
||||
phpSettings.display_startup_errors = 1
|
||||
phpSettings.display_errors = 1
|
||||
resources.frontController.params.displayExceptions = 1
|
||||
|
||||
[testing : production]
|
||||
phpSettings.display_startup_errors = 1
|
||||
phpSettings.display_errors = 1
|
@ -64,7 +64,7 @@ if ( isset($opts->file) )
|
||||
}
|
||||
// --- Don't play with *.tck files
|
||||
if ($extension == 'tck') {
|
||||
passthru(__DIR__ . '/fileTck.php --file '.$opts->file.' >> /home/log/tck.log 2>&1');
|
||||
passthru(__DIR__ . '/tck.php --file '.$opts->file.' >> /home/log/tck.log 2>&1');
|
||||
exit;
|
||||
}
|
||||
$client = basename(dirname($pathParts['dirname']));
|
||||
@ -82,7 +82,7 @@ if ( isset($opts->file) )
|
||||
$fluxRepository = str_replace(array($fluxBasePath.'/', '/'.$filenameIn), array('', ''), $opts->file);
|
||||
|
||||
// --- Match prestation
|
||||
$prestations = include __DIR__ . '/fileConfig.php';
|
||||
$prestations = include __DIR__ . '/config.php';
|
||||
$prestation = null;
|
||||
if (array_key_exists($client, $prestations)) {
|
||||
$clientPrestations = $prestations[$client]['prestations'];
|
@ -81,7 +81,7 @@ if ( isset($opts->file) )
|
||||
$fluxRepository = str_replace(array($fluxBasePath.'/', '/'.$filenameIn), array('', ''), $opts->file);
|
||||
|
||||
// --- Match prestation
|
||||
$prestations = include __DIR__ . '/fileConfig.php';
|
||||
$prestations = include __DIR__ . '/config.php';
|
||||
$prestation = null;
|
||||
if (array_key_exists($client, $prestations))
|
||||
{
|
@ -47,16 +47,16 @@ switch($opts->event)
|
||||
{
|
||||
case 'IN_CLOSE_WRITE':
|
||||
if ($extension == 'tck') {
|
||||
passthru(__DIR__ . '/fileTck.php --file '.$opts->file.' >> /home/log/tck.log 2>&1');
|
||||
passthru(__DIR__ . '/tck.php --file '.$opts->file.' >> /home/log/tck.log 2>&1');
|
||||
} else {
|
||||
passthru(__DIR__ . '/fileSend.php --file '.$opts->file.' >> /home/log/send.log 2>&1');
|
||||
passthru(__DIR__ . '/send.php --file '.$opts->file.' >> /home/log/send.log 2>&1');
|
||||
}
|
||||
break;
|
||||
case 'IN_ACCESS':
|
||||
case 'IN_CLOSE_NOWRITE':
|
||||
passthru(__DIR__ . '/fileRead.php --file '.$opts->file.' >> /home/log/read.log 2>&1');
|
||||
passthru(__DIR__ . '/read.php --file '.$opts->file.' >> /home/log/read.log 2>&1');
|
||||
break;
|
||||
case 'IN_DELETE':
|
||||
passthru(__DIR__ . '/fileRead.php --file '.$opts->file.' >> /home/log/read.log 2>&1');
|
||||
passthru(__DIR__ . '/read.php --file '.$opts->file.' >> /home/log/read.log 2>&1');
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user