IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Shell et commandes GNU Discussion :

Incron et inotify : ordre de traitement


Sujet :

Shell et commandes GNU

  1. #1
    Membre régulier
    Profil pro
    Inscrit en
    Avril 2007
    Messages
    210
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations forums :
    Inscription : Avril 2007
    Messages : 210
    Points : 91
    Points
    91
    Par défaut Incron et inotify : ordre de traitement
    Bonjour à tous,

    J'utilise Incron pour convertir des images (25 par seconde) en MD5.

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    /tmp/image/ IN_CREATE /home/seb/script.sh $@$#
    Malheureusement, il me semble qu'il ne le fasse pas dans l'ordre :


    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    0003.bmp
    0004.bmp
    0005.bmp
    0006.bmp
    0002.bmp
    0001.bmp
    0007.bmp
    0010.bmp
    0014.bmp
    0012.bmp
    ...

    Auriez vous une explication?
    Merci

  2. #2
    Modérateur
    Avatar de N_BaH
    Profil pro
    Inscrit en
    Février 2008
    Messages
    7 549
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2008
    Messages : 7 549
    Points : 19 377
    Points
    19 377
    Par défaut
    Bonjour,

    Citation Envoyé par sebaas
    J'utilise Incron pour convertir des images (25 par seconde) en MD5.
    et, on est puni ? on n'a pas le droit de voir le script ?

    mais, que veux-tu dire par "convertir des images en MD5" ?
    .
    N'oubliez pas de consulter les cours shell, la FAQ, et les pages man.

  3. #3
    Expert éminent Avatar de BufferBob
    Profil pro
    responsable R&D vidage de truites
    Inscrit en
    Novembre 2010
    Messages
    3 035
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations professionnelles :
    Activité : responsable R&D vidage de truites

    Informations forums :
    Inscription : Novembre 2010
    Messages : 3 035
    Points : 8 400
    Points
    8 400
    Par défaut
    salut,

    Citation Envoyé par sebaaas Voir le message
    J'utilise Incron pour convertir des images (25 par seconde) en MD5.
    non ça m'étonnerait, c'est un peu comme dire qu'on convertit une vache en yaourt, et incron ne sert pas à convertir dans tous les cas

    il me semble qu'il ne le fasse pas dans l'ordre (...) Auriez vous une explication?
    on peut supposer que les images n'ont pas toutes la même taille, donc quand elles arrivent dans le répertoire, l'image1 qui fait 800M mettra plus de temps à arriver complètement (création et remplissage du fichier) que l'image2 qui ne fait que 2M, résultat avec incron c'est premier arrivé premier servi, l'image2 sera traitée en priorité simplement parce qu'elle était disponible en premier

    on peut aussi supposer que les images n'arrivent pas depuis un unique processus, si le programme qui crée les images est multithreadé par exemple, rien ne garantit l'ordre d'arrivée des fichiers sur le disque

    enfin il y a d'autres considérations à prendre en compte comme l'ordre effectif des fichiers dans le répertoire (aka directory order, ls -U), qui sauf erreur n'est pas garantit et dépend entre autres du système de fichier et de la "sauce interne" de l'OS

  4. #4
    Responsable 2D/3D/Jeux


    Avatar de LittleWhite
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Mai 2008
    Messages
    26 858
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Ingénieur développement logiciels

    Informations forums :
    Inscription : Mai 2008
    Messages : 26 858
    Points : 218 577
    Points
    218 577
    Billets dans le blog
    120
    Par défaut
    Bonjour,

    incron/inotify étant des outils de surveillance de modification du système de fichiers, je ne pense pas que ce soit les outils les plus appropriés pour exécuter un script qui semble nécessité une exécution périodique. Un simple cron, ou ne serait-ce qu'un script avec un simple sleep devrait suffire. Sinon, vous avez surement une justification pour l'utilisation du incron .
    Vous souhaitez participer à la rubrique 2D/3D/Jeux ? Contactez-moi

    Ma page sur DVP
    Mon Portfolio

    Qui connaît l'erreur, connaît la solution.

  5. #5
    Membre régulier
    Profil pro
    Inscrit en
    Avril 2007
    Messages
    210
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations forums :
    Inscription : Avril 2007
    Messages : 210
    Points : 91
    Points
    91
    Par défaut
    Bonjour à tous,

    Il est vrai que je n'avais pas été très claire.

    Je vais reprendre dans l'ordre.

    1) j'utilise ffmpeg pour convertir une émission TV en images. Ces images sont placées dans un dossier /tmp/image/
    2) Incron surveille ce dossier
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    /tmp/image/ IN_CREATE /home/toto/script.sh $@$#
    A chaque création de fichier, le script s'exécute. Une video étant composé de 25 images / seconde, Incron lance le script (normalement) 25 fos par seconde
    3) le script suivant crée un MD5 de l'image, l'ajoute à dans un fichier CSV et supprime l'image
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    #!/bin/bash
    sleep 0.01
    md5sum $1 >> /home/toto/md5.csv
    rm $1
    Le problème est le suivant :
    Dans l'exemple qui suit (qui est le fichier md5.csv), l'image 2 et 3 ont été traitées avant la 1 ..

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    c7951b101b4d75ec07abf3ea2c6b602c  /tmp/image/laune-000000002.png
    c7951b101b4d75ec07abf3ea2c6b602c  /tmp/image/laune-000000003.png
    c7951b101b4d75ec07abf3ea2c6b602c  /tmp/image/laune-000000001.png
    c7951b101b4d75ec07abf3ea2c6b602c  /tmp/image/laune-000000004.png
    c7951b101b4d75ec07abf3ea2c6b602c  /tmp/image/laune-000000005.png
    c7951b101b4d75ec07abf3ea2c6b602c  /tmp/image/laune-000000008.png
    c7951b101b4d75ec07abf3ea2c6b602c  /tmp/image/laune-000000006.png
    c7951b101b4d75ec07abf3ea2c6b602c  /tmp/image/laune-000000007.png
    c7951b101b4d75ec07abf3ea2c6b602c  /tmp/image/laune-000000009.png
    c7951b101b4d75ec07abf3ea2c6b602c  /tmp/image/laune-000000010.png
    c7951b101b4d75ec07abf3ea2c6b602c  /tmp/image/laune-000000011.png
    c7951b101b4d75ec07abf3ea2c6b602c  /tmp/image/laune-000000012.png
    c7951b101b4d75ec07abf3ea2c6b602c  /tmp/image/laune-000000013.png
    c7951b101b4d75ec07abf3ea2c6b602c  /tmp/image/laune-000000014.png
    c7951b101b4d75ec07abf3ea2c6b602c  /tmp/image/laune-000000016.png
    c7951b101b4d75ec07abf3ea2c6b602c  /tmp/image/laune-000000015.png
    c7951b101b4d75ec07abf3ea2c6b602c  /tmp/image/laune-000000018.png
    c7951b101b4d75ec07abf3ea2c6b602c  /tmp/image/laune-000000017.png
    c7951b101b4d75ec07abf3ea2c6b602c  /tmp/image/laune-000000019.png
    c7951b101b4d75ec07abf3ea2c6b602c  /tmp/image/laune-000000020.png
    c7951b101b4d75ec07abf3ea2c6b602c  /tmp/image/laune-000000022.png
    c7951b101b4d75ec07abf3ea2c6b602c  /tmp/image/laune-000000021.png
    c7951b101b4d75ec07abf3ea2c6b602c  /tmp/image/laune-000000023.png
    c7951b101b4d75ec07abf3ea2c6b602c  /tmp/image/laune-000000024.png
    c7951b101b4d75ec07abf3ea2c6b602c  /tmp/image/laune-000000025.png
    75313dc32cbeb13cc927110e925cf5f1  /tmp/image/laune-000000026.png
    5e19ad91dfef49f1f3396ba3eb600fe1  /tmp/image/laune-000000027.png
    a121bd51bfc51853f7ba3382710fa44b  /tmp/image/laune-000000028.png
    8f0fec05ab01d875d4f67069e33c299b  /tmp/image/laune-000000029.png
    9385306f450761663962a2da939d6a94  /tmp/image/laune-000000032.png
    f03952ed2e3b847aa6d21823072950bf  /tmp/image/laune-000000031.png
    e67327fb2f860a622b3d35c03d37a2e6  /tmp/image/laune-000000030.png
    c7810cc10d7e1c5ef181ab7880a87607  /tmp/image/laune-000000033.png
    a1bc87a28328247200f0039bb06a64ba  /tmp/image/laune-000000036.png
    a64dfc1f8622704e4d7f6c1e987c7af3  /tmp/image/laune-000000034.png
    05726b43cfa5d8f07349fa4135347e1e  /tmp/image/laune-000000035.png
    26ca3bfc46d9287019efcc67ef077f3d  /tmp/image/laune-000000039.png
    ef4009295b291fc3a8bdbea2f2fcce10  /tmp/image/laune-000000037.png
    8b6337edea0d65af782cfb72bb01a368  /tmp/image/laune-000000040.png
    29607d8232ad664bebabdbf74fe8e3af  /tmp/image/laune-000000038.png
    93fe0e0f7935b08429fbb7424a625440  /tmp/image/laune-000000041.png
    2c8730368381909af51b607acb7d22a9  /tmp/image/laune-000000042.png
    bfc8551c7ef226d5b31b730ebcceaed1  /tmp/image/laune-000000043.png
    132a118529bb99eff836ddfad85423c5  /tmp/image/laune-000000044.png
    1b5d45924d196acd3784eaec8a464aa9  /tmp/image/laune-000000046.png
    6368a1605d3a979445df3fabf08bc25b  /tmp/image/laune-000000048.png
    82fb0ce40a9fe0a97f17e8f86191eb49  /tmp/image/laune-000000047.png
    4645b6bc8e25529d30d9b7cc8f254021  /tmp/image/laune-000000045.png
    23c85b40cf79ee602a524c2bc61f7e96  /tmp/image/laune-000000050.png
    1ffc85d1af3207120b47bfba3724f81e  /tmp/image/laune-000000049.png
    8cfffc21f04729f98107416be3f1f4e1  /tmp/image/laune-000000051.png
    b42bbf0d43dd779ccbad8eac94661a24  /tmp/image/laune-000000052.png
    408bde069b929cb692614f7c5e4616c8  /tmp/image/laune-000000054.png
    024f57ad61aab01904aee63258c3fd4f  /tmp/image/laune-000000055.png
    adfc10ac568d0bd0387c80cccf2aefd4  /tmp/image/laune-000000053.png
    4be1da095571c806aeb0c806db011694  /tmp/image/laune-000000056.png
    a009737a44d8d67ec0d76e2d03249a3f  /tmp/image/laune-000000058.png
    437826c96861f93435809645a3360266  /tmp/image/laune-000000059.png
    b937a69e941c0220e7dfea3f03fb1bf7  /tmp/image/laune-000000057.png
    d8b6cc65c2a660f899396b039c695071  /tmp/image/laune-000000060.png
    14efaa7217d07549e0b46c5067ec1920  /tmp/image/laune-000000063.png
    a6ce621fc6fc4c083c0b6bbc6d9ed5f2  /tmp/image/laune-000000061.png
    b2a9e0366437aab07c88d54fe438399e  /tmp/image/laune-000000062.png
    c4cd3e1f27c8f17d49e069610455b042  /tmp/image/laune-000000065.png
    c6acaf33774832d02b4373cc1f55c78a  /tmp/image/laune-000000064.png
    8d80949aedbc5068583cf16250af7816  /tmp/image/laune-000000066.png
    3d51f5015c9e40f9f7d3079ea15a447b  /tmp/image/laune-000000067.png
    c7a56feea310d38ba193d21c95cd6488  /tmp/image/laune-000000071.png
    09a9d8f6cc9d35c315a9fd7c2ed83987  /tmp/image/laune-000000069.png
    bbaff53f7937e01c17ebaca486b632ae  /tmp/image/laune-000000070.png
    fe36c7d2fdbd25bf707401a9104eb96d  /tmp/image/laune-000000068.png
    1d332f77f638c27220b4f0d2f005499b  /tmp/image/laune-000000072.png
    1e83223a9de50c0fc9a251afcebe0b91  /tmp/image/laune-000000073.png
    1b57c08bfbb946ae8981527a9ec2d8df  /tmp/image/laune-000000078.png
    f9d854a71b19008e2efbc3dbe7e755cd  /tmp/image/laune-000000074.png
    c4e865af34e8c21edd96a4e66ab8da33  /tmp/image/laune-000000075.png
    c4e865af34e8c21edd96a4e66ab8da33  /tmp/image/laune-000000077.png
    91f2a6b7354f8f4dd15e2610c53546cb  /tmp/image/laune-000000079.png
    c4e865af34e8c21edd96a4e66ab8da33  /tmp/image/laune-000000076.png
    91f2a6b7354f8f4dd15e2610c53546cb  /tmp/image/laune-000000081.png
    3679ed21a8c6a6adbf5a8f36375926e1  /tmp/image/laune-000000082.png
    f9b28c57cdce5873b0176650d6aab3be  /tmp/image/laune-000000083.png
    ee5541c8acd8682da8158b2cf8cdfc8b  /tmp/image/laune-000000085.png
    91f2a6b7354f8f4dd15e2610c53546cb  /tmp/image/laune-000000080.png
    f9b28c57cdce5873b0176650d6aab3be  /tmp/image/laune-000000084.png
    e1042047a854f24b2e92b8b1e535ee65  /tmp/image/laune-000000086.png
    f9c923d660cbaed0d50aa65bf37c3eac  /tmp/image/laune-000000088.png
    575176e4963de83dc7f65efaeec23904  /tmp/image/laune-000000087.png
    a97690bcbbf2234fe970dc47c07c2f71  /tmp/image/laune-000000089.png
    76fe4761fd63fc9d556e8dbb502b9a27  /tmp/image/laune-000000092.png
    b164e3da2f0a57fbfb7778cc562183f5  /tmp/image/laune-000000093.png
    bd1da9c2f4a344579ed1a88371c3b8bc  /tmp/image/laune-000000097.png
    e24412be3f083c0944e9edf0b6207593  /tmp/image/laune-000000090.png
    b51b84eb82138fee9409ccfa61432148  /tmp/image/laune-000000091.png
    9b9e32ef9ed0c31be20174dc354b1a41  /tmp/image/laune-000000094.png
    43356c738819153a7eda11e7e9f1754d  /tmp/image/laune-000000095.png
    9f8e52418a13aeaff7f7c41e2df1d943  /tmp/image/laune-000000096.png
    6a6a0838aa1e5ce4afa7dcdb7b15df7d  /tmp/image/laune-000000099.png
    eee6bb58dbf3f146a5c4f1bddb1bcf88  /tmp/image/laune-000000098.png
    946c58c49ecd312d6e59849fd3c839c1  /tmp/image/laune-000000100.png
    8e29c4e304a9441892802e97f9748842  /tmp/image/laune-000000101.png
    12dc5072f5ae572a0b4721b4a58feaa0  /tmp/image/laune-000000104.png
    a0e58cd51e3e7227bcac12bd1dbb11aa  /tmp/image/laune-000000102.png
    7b8f291ac58c6de68b00042142ad4af1  /tmp/image/laune-000000105.png
    9fcc853be66bb0c00d9ee81477767588  /tmp/image/laune-000000103.png
    ce530a19fcb180c7c9ebf69004d04b40  /tmp/image/laune-000000106.png
    1fb37f39fd090e7abd6b2b9aee686200  /tmp/image/laune-000000107.png
    96f5717acddae499d762c3b1300fb157  /tmp/image/laune-000000109.png
    170854b27d9d535f2d02f730e3b5df7c  /tmp/image/laune-000000108.png
    7ce2a5697aa62bf24e7f0dc48fb5a1c2  /tmp/image/laune-000000110.png
    2f67d6058dc960bc12942ad028b996f5  /tmp/image/laune-000000111.png
    7a09e13e327a8783fac61d85c1fbf2e7  /tmp/image/laune-000000112.png
    04ce6fbf37ab9d41733242e16c7cd49a  /tmp/image/laune-000000113.png
    871f3662db302a0994e875ac36dcfbd9  /tmp/image/laune-000000115.png
    29d1925e5e7508d5b0d479e249efb337  /tmp/image/laune-000000114.png
    f00115d398fe864ee5d6c8a08a4cb656  /tmp/image/laune-000000116.png
    c66a74b90795dc981f08a95687251681  /tmp/image/laune-000000117.png
    fd186dae0b484c462de3bd2eb16aca6a  /tmp/image/laune-000000118.png
    3e9763258c7e381ffa389805233b80b1  /tmp/image/laune-000000119.png
    10c3aabf1daec6c559eb62d13a570df4  /tmp/image/laune-000000121.png
    8c97d649f017f755e07abb0f40edebdb  /tmp/image/laune-000000120.png
    4ef0029e25503e04c76056b69b67e43e  /tmp/image/laune-000000123.png
    df1468dc4be2a80357f883344d6b4e70  /tmp/image/laune-000000122.png
    0ae91efc14785fcef5afb77cf704201e  /tmp/image/laune-000000126.png
    a833e0c5b3efb2af0db38e40f9c7f314  /tmp/image/laune-000000124.png
    a4d00578528ecbf20220e2389e464fae  /tmp/image/laune-000000125.png
    22496435b9b4d52a3ba66fd59c247575  /tmp/image/laune-000000127.png
    00e0f351558d234bf4af2dfb76b4c9d3  /tmp/image/laune-000000129.png
    817adc08744db43efafe99edec1cb2d2  /tmp/image/laune-000000130.png
    7b9afe8e0e71c3fbb4f3d98673dced62  /tmp/image/laune-000000128.png
    aac0cc107f5cd0a41af0c51020fe5a4a  /tmp/image/laune-000000131.png
    8d156f90edd9939506320127c0bca6a2  /tmp/image/laune-000000133.png
    6667e8527d8cdc67ad17b8a3a2a0698c  /tmp/image/laune-000000135.png
    3585c3840dfa6963a33e0874db934b68  /tmp/image/laune-000000132.png
    40e73792421aab77cdc479d51db90953  /tmp/image/laune-000000134.png
    c0ff12c0c8b755aeb6b03652d3a841c8  /tmp/image/laune-000000137.png
    11e321e729ce0a4e81c22fadb71152d1  /tmp/image/laune-000000139.png
    31864fd28363044fdb5753ba455657a3  /tmp/image/laune-000000136.png
    eb4a4697f2c3e928bfb814784798f261  /tmp/image/laune-000000138.png
    6b74d9681dc4922ead4a6b3a1a458791  /tmp/image/laune-000000140.png
    ab58e024048b28fc672235bb1460aad6  /tmp/image/laune-000000142.png
    5bdd9f2d5baa1948ea2e99859a925f12  /tmp/image/laune-000000141.png
    da917780b4a2d7167b8db6dd291c2724  /tmp/image/laune-000000144.png
    0174154752a562eee49a494492bcaba1  /tmp/image/laune-000000143.png
    84ad2c64bfc1a8033845bec75e99c1a9  /tmp/image/laune-000000145.png
    0f4632efa103ed52803b7d2c0d1552ef  /tmp/image/laune-000000146.png
    c5efce6a3205e731f2f1fc107aa00949  /tmp/image/laune-000000148.png
    1f197c00231dfe36b5cab45c4011eb80  /tmp/image/laune-000000147.png
    86faadacbd0c8f4a5223bef3c8f612d4  /tmp/image/laune-000000149.png
    83a6f10eeb53040c2e97a451dcf0fdc0  /tmp/image/laune-000000150.png
    af07c7f3fd1e27f4ff4449a2ed0c1c09  /tmp/image/laune-000000152.png
    4232a07868d350998b0ada4f96cba302  /tmp/image/laune-000000151.png
    9be8f895e10055a8eb112009f266782a  /tmp/image/laune-000000153.png
    af1fc95bb4cb70fdb3cb9e73c3ef8633  /tmp/image/laune-000000154.png
    e9f53598becb6cca3fef005df323b139  /tmp/image/laune-000000155.png
    7343dd20cd94c894b6cf965ba6c9b646  /tmp/image/laune-000000156.png
    3331b1dc4efcba4f0472e2ae8b4a1056  /tmp/image/laune-000000157.png
    c97804b0da7d11e82894c466cef02ec6  /tmp/image/laune-000000158.png
    c14e14c8457ecb16b981dd19f31a8e94  /tmp/image/laune-000000159.png
    b3c00ffcff37f2f5a3f0086e6ed175c7  /tmp/image/laune-000000160.png
    7ee44a821aa8435cf778519fc1c88647  /tmp/image/laune-000000161.png
    963b4483d5874b431857eabdfd6c33d9  /tmp/image/laune-000000162.png
    c49d8cb5513278f96a288aa05db4a396  /tmp/image/laune-000000163.png
    33de4762c869ef638a964ec30fcbe9cb  /tmp/image/laune-000000164.png
    8b69c30abf97ffd5672ae3f6d1955497  /tmp/image/laune-000000165.png
    c2d7c1e0bfc5d1d1b109d55f9734118e  /tmp/image/laune-000000166.png
    298b2536d0d9b06fd18bd360ab6d1b1b  /tmp/image/laune-000000167.png
    e77d5dbaccf424758c7b07a937f1fb82  /tmp/image/laune-000000168.png
    f6c360e3c12a28dec2db48ec7844e888  /tmp/image/laune-000000169.png
    9fd87c9f844732b6f0307ddf7eaf0515  /tmp/image/laune-000000170.png
    dac5618c70cfe7587c4577580b580084  /tmp/image/laune-000000171.png
    a0ce3273b7bf909203f7e991ed021bc4  /tmp/image/laune-000000172.png
    0dc94252f32af66339a8cadaaa1726b8  /tmp/image/laune-000000173.png
    794b37f3781ca2d12c692a862040054d  /tmp/image/laune-000000174.png
    ff2e7ba9e556f1745c185b38857a6f9e  /tmp/image/laune-000000175.png
    6b4e094cdcb2f18900186ecf9a5d1879  /tmp/image/laune-000000176.png
    27dc50ec44c7301e3b50330efdaa5cda  /tmp/image/laune-000000177.png
    93e1527f83a69ac0818e6f4df740f34c  /tmp/image/laune-000000178.png
    64872cfe8616b45446e02dd8e42b95ab  /tmp/image/laune-000000179.png
    5df24c3aa05c212983b3c40c8480c0f2  /tmp/image/laune-000000180.png
    b4bd8cb4915b713490a70f725885eee6  /tmp/image/laune-000000181.png
    a2dc73645892d5a4489a8a72ef686156  /tmp/image/laune-000000182.png
    227087b10a40857eaa00be7331e6a7a8  /tmp/image/laune-000000183.png
    8ca317e6a43644618ffe894f50e211b0  /tmp/image/laune-000000184.png
    f343c1b1da6fb76e51615ab0dc14eb03  /tmp/image/laune-000000185.png
    f033144308d4fd9d23d2d1ae4b9fb962  /tmp/image/laune-000000186.png
    6d0550ef90bd33b11bf771d240988b0b  /tmp/image/laune-000000187.png
    295ffbbd382df388de8c47698932c8b3  /tmp/image/laune-000000188.png
    b20e4900002bd1c18c3097993c38fa46  /tmp/image/laune-000000189.png
    535e028a78c75df80fdb3b9ea29885e6  /tmp/image/laune-000000190.png
    c5e39da2c63a7aabb9289df01129a34b  /tmp/image/laune-000000191.png
    ca5db08c03f1765b1fc1cd2d83988c85  /tmp/image/laune-000000192.png
    4d132b0eddcf0671a0ebfafab7b2e560  /tmp/image/laune-000000193.png
    00e7f4d91428bacc1fa6a41ec7f11b43  /tmp/image/laune-000000194.png
    a0422bd14d8368fabe7125cf543873b5  /tmp/image/laune-000000195.png
    85a5a8922b24cfdf7dbad8ba0ffdc3a8  /tmp/image/laune-000000196.png
    a8c500558ca6d10bc46b4e861f747d85  /tmp/image/laune-000000197.png
    d56266094393eee0892b3751edf2cf1b  /tmp/image/laune-000000198.png
    0969fc8db1fbbe04f74f8d1d45b47611  /tmp/image/laune-000000199.png
    b8dce82e5fa8f764dadf31310ad3094c  /tmp/image/laune-000000200.png
    0b914c53c5c04097455d1ec7981429d5  /tmp/image/laune-000000201.png
    50713fda9229357e5cf4e9f9700d2f78  /tmp/image/laune-000000202.png
    d5d92b884b2884934b0c0faba7e8e586  /tmp/image/laune-000000203.png
    b264dd30a4ffe80a111586747d1acfb8  /tmp/image/laune-000000204.png
    8fc3d1207bc9375c9a5b2cb6ef0c47a4  /tmp/image/laune-000000205.png
    9fe1af95a2dc49b08e238b38952e7c28  /tmp/image/laune-000000206.png
    a78e57043f099373bc682be348373cd8  /tmp/image/laune-000000207.png
    f2de02fc836c22a9011aa15321092a5b  /tmp/image/laune-000000208.png
    b2d0cb2cf3e9ffb13e29f59222187241  /tmp/image/laune-000000209.png
    0cef95f3a2ab8ae2c9946b3d5607005b  /tmp/image/laune-000000210.png
    21cafb95a794b646cdcdf885febbefb7  /tmp/image/laune-000000211.png
    81822f4c4c7ddfa044408f889b82699f  /tmp/image/laune-000000212.png
    add1aeb04b64e0b4d0832417c30e02f4  /tmp/image/laune-000000213.png
    36a28a399705098bd4008283e6395cea  /tmp/image/laune-000000214.png
    b997c934a6771e78ae72d25423aa4a1a  /tmp/image/laune-000000215.png
    d8812524d642c306392fd471086a7a05  /tmp/image/laune-000000216.png
    1c478e7af0b94100c8e3c3469408cb5b  /tmp/image/laune-000000217.png
    93352aa717d7149b05fa05ff6df9a09e  /tmp/image/laune-000000218.png
    e12a849da6aa51f7a67aa89015f17ddb  /tmp/image/laune-000000220.png
    aa0ac80fec0957d39b85c6514fd2aa60  /tmp/image/laune-000000219.png
    997daffc15057bb1019cf4a750dcafa2  /tmp/image/laune-000000221.png

  6. #6
    Expert confirmé
    Avatar de Loceka
    Profil pro
    Inscrit en
    Mars 2004
    Messages
    2 276
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2004
    Messages : 2 276
    Points : 4 845
    Points
    4 845
    Par défaut
    La réponse de BufferBob reste d'actualité.

    Le plus simple si tu ne veux pas te prendre la tête inutilement c'est de réordonner ton fichier CSV à la fin du traitement.

  7. #7
    Expert éminent Avatar de BufferBob
    Profil pro
    responsable R&D vidage de truites
    Inscrit en
    Novembre 2010
    Messages
    3 035
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations professionnelles :
    Activité : responsable R&D vidage de truites

    Informations forums :
    Inscription : Novembre 2010
    Messages : 3 035
    Points : 8 400
    Points
    8 400
    Par défaut
    salut (ça faisait longtemps ),

    par hasard est-ce que rajouter l'option -threads 1 à ffmpeg permet de changer quelque chose ?

  8. #8
    Membre régulier
    Profil pro
    Inscrit en
    Avril 2007
    Messages
    210
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations forums :
    Inscription : Avril 2007
    Messages : 210
    Points : 91
    Points
    91
    Par défaut
    Bonjour à tous,

    1)concernant le trie : faisant une boucle sans fin, le problème se posera tout le temps
    2) ffmpeg crée les fichiers dans le bon ordre, le problème est dans incron

    La solution trouvée un script bash avec la boucle suivante :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    while true
    do
    for image in /tmp/image
    do
    md5sum $image >> fichier.txt
    done
    done
    Merci

  9. #9
    Expert éminent Avatar de BufferBob
    Profil pro
    responsable R&D vidage de truites
    Inscrit en
    Novembre 2010
    Messages
    3 035
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations professionnelles :
    Activité : responsable R&D vidage de truites

    Informations forums :
    Inscription : Novembre 2010
    Messages : 3 035
    Points : 8 400
    Points
    8 400
    Par défaut
    Citation Envoyé par sebaaas Voir le message
    1)concernant le trie : faisant une boucle sans fin, le problème se posera tout le temps
    je vois pas pourquoi. tout dépend comment tu codes la chose, tu pourrais très bien t'arranger pour traiter la totalité des fichiers d'un coup toutes les 1s

    2) ffmpeg crée les fichiers dans le bon ordre
    qu'est-ce qui te fait dire ça ? par ailleurs entre ffmpeg et inotify il y a le système de fichiers et ses capacités.

    le problème est dans incron
    franchement ça m'étonnerait, inotify réagit dès qu'il voit un changement, il n'y a aucune raison pour laquelle il pourrait retarder une action au profit d'une autre déclenchée plus tardivement, je verrais plus ça comme un problème une fonctionnalité liée au filesystem et/ou à sa configuration

    dans tous les cas ça ne te coutait rien de tester l'option pour t'assurer que ça n'améliore pas les choses, là tu te contente d'être catégorique sans donner aucune preuve d'aucune sorte...

    une version modifiée de ton code, le minimum pour que ça fonctionne comme voulu :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    while true; do
       for image in /tmp/image/; do
          md5sum "$image" >> fichier.txt && rm "$image"
       done
       sleep 1
    done
    bon courage

  10. #10
    Membre régulier
    Profil pro
    Inscrit en
    Avril 2007
    Messages
    210
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations forums :
    Inscription : Avril 2007
    Messages : 210
    Points : 91
    Points
    91
    Par défaut
    Merci pour vos réponses.

  11. #11
    Modérateur
    Avatar de N_BaH
    Profil pro
    Inscrit en
    Février 2008
    Messages
    7 549
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2008
    Messages : 7 549
    Points : 19 377
    Points
    19 377
    Par défaut
    LA solution

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    for image in /tmp/image/*.png
    sinon, vous n'irez pas bien loin dans le répertoire. :/

    la boucle ne sert d'ailleurs à rien si tu n'as rien d'autre à faire avec les images :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    while true; do
       md5sum /tmp/images/*.png >/fichier.txt
       rm /tmp/images/*.png
    done
    mais j'espère que tu as un bon ventilo sur ta bécane, parce qu'une boucle infinie de ce type risque de vite bouffer les ressources...
    .
    N'oubliez pas de consulter les cours shell, la FAQ, et les pages man.

Discussions similaires

  1. Ordre de traitement d'affichage (html avant js)
    Par jamesleouf dans le forum Général JavaScript
    Réponses: 5
    Dernier message: 18/07/2008, 15h12
  2. [SSIS][2k5]Data Flow Ordre de traitement
    Par maxo dans le forum SSIS
    Réponses: 5
    Dernier message: 16/03/2008, 15h43
  3. Ordre de traitement des opérateurs sur un select
    Par tchoimars dans le forum Langage SQL
    Réponses: 1
    Dernier message: 16/05/2007, 18h42
  4. [D7]Ordre de traitement des commandes
    Par PBSDev dans le forum Langage
    Réponses: 1
    Dernier message: 06/02/2006, 15h05
  5. [XSL] ordre de traitement des apply-templates
    Par Invité dans le forum XSL/XSLT/XPATH
    Réponses: 5
    Dernier message: 24/01/2006, 11h19

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo