Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15

Thread: mktemp - duplicate files/dirs ...

  1. #11
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    24,989
    Blog Entries
    15

    Default Re: mktemp - duplicate files/dirs ...

    On Fri 07 Dec 2018 01:56:03 PM CST, hcvv wrote:


    My conclusion, it is not mktemp that acts double, but your script is
    called twice.

    Any chance you have your udev rule a second time somewhere?
    Again, just guessing and offering starting points for thought.


    Hi
    Sounds possible, check in /lib/udev/rules.d/ also the number is
    important, 10-* is very low down the pecking order if you inspect the
    main udev directory. I would suggest 60-* or even 99-*.

    You can also monitor what is happening via the udevadm command;

    Code:
    udevadm monitor
    --
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SLES 15 | GNOME Shell 3.26.2 | 4.12.14-25.25-default
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!


  2. #12

    Default Re: mktemp - duplicate files/dirs ...

    Quote Originally Posted by hcvv View Post
    My conclusion, it is not mktemp that acts double, but your script is called twice.
    Spot on !

    Any chance you have your udev rule a second time somewhere?
    Nope - but changed the names (cfr infra)

    Again, just guessing and offering starting points for thought.
    You've already solved more than I did ;-)


    Code:
    hanoi:~ # cat /etc/udev/rules.d/10-abu.rules 
    SUBSYSTEM=="block", ACTION=="add", ATTRS{idVendor}=="174c", SYMLINK+="abul%n",RUN+="/bin/abu_01.sh"
    hanoi:~ # cat /bin/abu_01.sh 
    #!/bin/bash
    date +%M:%S:%N >> /tmp/buTIME.TXT
    hanoi:~ # cat /tmp/buTIME.TXT 
    51:42:410969346
    51:42:514929849
    ... and that problem is documented - so yes: you saved my day :-)

  3. #13
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    23,782

    Default Re: mktemp - duplicate files/dirs ...

    Quote Originally Posted by baudrez View Post

    ... and that problem is documented - so yes: you saved my day :-)
    Glad to be of help.

    After you provided the maximum of information, it is only working step by step, trying to let your brain not jump/skip. It often works, even if one does not know all the details behind it (I know about edev rules, but I am not fluent with them).
    Henk van Velden

  4. #14

    Default Re: mktemp - duplicate files/dirs ...

    The problem was that the USB device 'as such' and the (only) partition, both triggered an action with the defined rule !

    So i had to change the rule, to designate only the partition (and in the meantime taking into account Malcolm's remark!)
    Code:
    hanoi:~ # cat /etc/udev/rules.d/90-abu.rules
    SUBSYSTEM=="block", ACTION=="add", ATTRS{idVendor}=="174c", ENV{ID_PART_ENTRY_UUID}=="3b0dfc94-01", SYMLINK+="abul%n",RUN+="/bin/abu_01.sh"
    Got the ID_PART_ENTRY_UUID from:
    Code:
    hanoi:~ # udevadm info --name=/dev/sdc1 | grep -i id_part
    E: ID_PART_ENTRY_DISK=8:32
    E: ID_PART_ENTRY_NUMBER=1
    E: ID_PART_ENTRY_OFFSET=2048
    E: ID_PART_ENTRY_SCHEME=dos
    E: ID_PART_ENTRY_SIZE=468858880
    E: ID_PART_ENTRY_TYPE=0x83
    E: ID_PART_ENTRY_UUID=3b0dfc94-01
    E: ID_PART_TABLE_TYPE=dos
    E: ID_PART_TABLE_UUID=3b0dfc94
    and now I have only ONE run of the script :-)

    Thanks to you all!

  5. #15
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    23,782

    Default Re: mktemp - duplicate files/dirs ...

    Congratulations.

    Yes, there was one other thing that was not realy covered in your original probem description: the nature of the device.

    Somewhere in the background of my brain I "assumed" that it probably was mass strorage, but did not pay any attention to that. And as all know "assuming" is the start of a confusing discussion.
    Henk van Velden

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •